pax_global_header00006660000000000000000000000064136765151250014525gustar00rootroot0000000000000052 comment=66cc52b742c092872478509a14a8e0e3a3a632a4 php-phpdocumentor-reflection-common-2.2.0/000077500000000000000000000000001367651512500206205ustar00rootroot00000000000000php-phpdocumentor-reflection-common-2.2.0/.github/000077500000000000000000000000001367651512500221605ustar00rootroot00000000000000php-phpdocumentor-reflection-common-2.2.0/.github/dependabot.yml000066400000000000000000000002021367651512500250020ustar00rootroot00000000000000version: 2 updates: - package-ecosystem: composer directory: "/" schedule: interval: daily open-pull-requests-limit: 10 php-phpdocumentor-reflection-common-2.2.0/.github/workflows/000077500000000000000000000000001367651512500242155ustar00rootroot00000000000000php-phpdocumentor-reflection-common-2.2.0/.github/workflows/push.yml000066400000000000000000000146541367651512500257310ustar00rootroot00000000000000on: 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 php-phpdocumentor-reflection-common-2.2.0/.gitignore000066400000000000000000000006431367651512500226130ustar00rootroot00000000000000# IDE Shizzle; it is recommended to use a global .gitignore for this but since this is an OSS project we want to make # it easy to contribute .idea /nbproject/private/ .buildpath .project .settings # Build folder and vendor folder are generated code; no need to version this build/ temp/ tools/ vendor/ *.phar # By default the phpunit.xml.dist is provided; you can override this using a local config file phpunit.xml php-phpdocumentor-reflection-common-2.2.0/.scrutinizer.yml000066400000000000000000000022151367651512500240020ustar00rootroot00000000000000before_commands: - "composer install --no-dev --prefer-source" checks: php: excluded_dependencies: - phpstan/phpstan tools: external_code_coverage: enabled: true timeout: 300 filter: excluded_paths: ["tests", "vendor"] php_code_sniffer: enabled: true config: standard: PSR2 filter: paths: ["src/*", "tests/*"] excluded_paths: [] php_cpd: enabled: true excluded_dirs: ["tests", "vendor"] php_cs_fixer: enabled: true config: level: all filter: paths: ["src/*", "tests/*"] php_loc: enabled: true excluded_dirs: ["tests", "vendor"] php_mess_detector: enabled: true config: ruleset: phpmd.xml.dist design_rules: { eval_expression: false } filter: paths: ["src/*"] php_pdepend: enabled: true excluded_dirs: ["tests", "vendor"] php_analyzer: enabled: true filter: paths: ["src/*", "tests/*"] sensiolabs_security_checker: true php-phpdocumentor-reflection-common-2.2.0/LICENSE000066400000000000000000000020711367651512500216250ustar00rootroot00000000000000The 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. php-phpdocumentor-reflection-common-2.2.0/Makefile000066400000000000000000000023651367651512500222660ustar00rootroot00000000000000.PHONY: install-phive install-phive: mkdir tools; \ wget -O tools/phive.phar https://github.com/phar-io/phive/releases/download/0.13.2/phive-0.13.2.phar; \ wget -O tools/phive.phar.asc https://github.com/phar-io/phive/releases/download/0.13.2/phive-0.13.2.phar.asc; \ gpg --keyserver pool.sks-keyservers.net --recv-keys 0x9D8A98B29B2D5D79; \ gpg --verify tools/phive.phar.asc tools/phive.phar; \ chmod +x tools/phive.phar .PHONY: setup setup: install-phive docker run -it --rm -v${PWD}:/opt/project -w /opt/project phpdoc/phar-ga:latest php tools/phive.phar install --force-accept-unsigned .PHONY: phpcs phpcs: docker run -it --rm -v${PWD}:/opt/project -w /opt/project phpdoc/phpcs-ga:latest -s .PHONY: phpcbf phpcbf: docker run -it --rm -v${PWD}:/opt/project -w /opt/project phpdoc/phpcs-ga:latest phpcbf .PHONY: phpstan phpstan: docker run -it --rm -v${PWD}:/opt/project -w /opt/project phpdoc/phpstan-ga:latest analyse src --no-progress --configuration phpstan.neon .PHONY: psalm psalm: docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:7.2 tools/psalm --show-info=true .PHONY: test test: docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:7.2 tools/phpunit .PHONY: pre-commit-test pre-commit-test: test phpcs phpstan psalm php-phpdocumentor-reflection-common-2.2.0/README.md000066400000000000000000000021171367651512500221000ustar00rootroot00000000000000[![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 ================ php-phpdocumentor-reflection-common-2.2.0/composer.json000066400000000000000000000012741367651512500233460ustar00rootroot00000000000000{ "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" } } } php-phpdocumentor-reflection-common-2.2.0/composer.lock000066400000000000000000000010641367651512500233220ustar00rootroot00000000000000{ "_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": "d930d0012b641501a862411b6777b20e", "packages": [], "packages-dev": [], "aliases": [], "minimum-stability": "stable", "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { "php": ">=7.1" }, "platform-dev": [] } php-phpdocumentor-reflection-common-2.2.0/phive.xml000066400000000000000000000004271367651512500224600ustar00rootroot00000000000000 php-phpdocumentor-reflection-common-2.2.0/phpcs.xml.dist000066400000000000000000000003661367651512500234260ustar00rootroot00000000000000 The coding standard for phpDocumentor. src tests/unit php-phpdocumentor-reflection-common-2.2.0/phpmd.xml.dist000066400000000000000000000015151367651512500234160ustar00rootroot00000000000000 40 php-phpdocumentor-reflection-common-2.2.0/phpstan.neon000066400000000000000000000000331367651512500231520ustar00rootroot00000000000000parameters: level: max php-phpdocumentor-reflection-common-2.2.0/phpunit.xml.dist000066400000000000000000000014641367651512500240000ustar00rootroot00000000000000 ./tests/unit/ src php-phpdocumentor-reflection-common-2.2.0/psalm.xml000066400000000000000000000006611367651512500224610ustar00rootroot00000000000000 php-phpdocumentor-reflection-common-2.2.0/src/000077500000000000000000000000001367651512500214075ustar00rootroot00000000000000php-phpdocumentor-reflection-common-2.2.0/src/Element.php000066400000000000000000000010031367651512500235030ustar00rootroot00000000000000fqsen = $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; } } php-phpdocumentor-reflection-common-2.2.0/src/Location.php000066400000000000000000000022161367651512500236710ustar00rootroot00000000000000lineNumber = $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; } } php-phpdocumentor-reflection-common-2.2.0/src/Project.php000066400000000000000000000007721367651512500235340ustar00rootroot00000000000000assertEquals($name, $instance->getName()); } /** * Data provider for ValidFormats tests. Contains a complete list from psr-5 draft. * * @return array> */ public function validFqsenProvider() : array { return [ ['\\', ''], ['\My\Space', 'Space'], ['\My\Space\myFunction()', 'myFunction'], ['\My\Space\MY_CONSTANT', 'MY_CONSTANT'], ['\My\Space\MY_CONSTANT2', 'MY_CONSTANT2'], ['\My\Space\MyClass', 'MyClass'], ['\My\Space\MyInterface', 'MyInterface'], ['\My\Space\Option«T»', 'Option«T»'], ['\My\Space\MyTrait', 'MyTrait'], ['\My\Space\MyClass::myMethod()', 'myMethod'], ['\My\Space\MyClass::$my_property', 'my_property'], ['\My\Space\MyClass::MY_CONSTANT', 'MY_CONSTANT'], ]; } /** * @covers ::__construct * @dataProvider invalidFqsenProvider */ public function testInValidFormats(string $fqsen) : void { $this->expectException(InvalidArgumentException::class); new Fqsen($fqsen); } /** * Data provider for invalidFormats tests. Contains a complete list from psr-5 draft. * * @return array> */ public function invalidFqsenProvider() : array { return [ ['\My\*'], ['\My\Space\.()'], ['My\Space'], ['1_function()'], ]; } /** * @covers ::__construct * @covers ::__toString */ public function testToString() : void { $className = new Fqsen('\\phpDocumentor\\Application'); $this->assertEquals('\\phpDocumentor\\Application', (string) $className); } }