Mise à jour du dossier vendor

This commit is contained in:
nox 2019-10-25 00:13:47 +02:00
parent 922d087c61
commit 4537df1b5f
1046 changed files with 83512 additions and 1 deletions

1
.gitignore vendored
View File

@ -3,5 +3,4 @@ config/conf.php
.idea
/public/uploads
/tmp
vendor
composer.lock

View File

@ -0,0 +1,48 @@
before_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

View File

@ -0,0 +1,52 @@
build: false
clone_folder: c:\reflectioncommon
max_jobs: 3
platform: x86
pull_requests:
do_not_increment_build_number: true
version: '{build}.{branch}'
skip_tags: true
branches:
only:
- master
environment:
matrix:
- php_ver_target: 7.1
- php_ver_target: 7.2
matrix:
fast_finish: false
cache:
- c:\php -> appveyor.yml
- '%LOCALAPPDATA%\Composer\files'
init:
- SET PATH=C:\Program Files\OpenSSL;c:\tools\php;%PATH%
- SET COMPOSER_NO_INTERACTION=1
- SET PHP=1
- SET ANSICON=121x90 (121x90)
install:
- IF EXIST c:\tools\php (SET PHP=0)
- ps: appveyor-retry cinst --params '""/InstallDir:C:\tools\php""' --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $env:php_ver_target | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','')
- cd c:\tools\php
- IF %PHP%==1 copy /Y php.ini-development php.ini
- IF %PHP%==1 echo max_execution_time=1200 >> php.ini
- IF %PHP%==1 echo date.timezone="UTC" >> php.ini
- IF %PHP%==1 echo extension_dir=ext >> php.ini
- IF %PHP%==1 echo extension=php_curl.dll >> php.ini
- IF %PHP%==1 echo extension=php_openssl.dll >> php.ini
- IF %PHP%==1 echo extension=php_mbstring.dll >> php.ini
- IF %PHP%==1 echo extension=php_fileinfo.dll >> php.ini
- IF %PHP%==1 echo zend.assertions=1 >> php.ini
- IF %PHP%==1 echo assert.exception=On >> php.ini
- IF %PHP%==1 echo @php %%~dp0composer.phar %%* > composer.bat
- appveyor-retry appveyor DownloadFile https://getcomposer.org/composer.phar
- cd c:\reflectioncommon
- composer install --no-interaction --prefer-dist --no-progress
test_script:
- cd c:\reflectioncommon
- vendor\bin\phpunit --no-coverage

View File

@ -0,0 +1,17 @@
includes:
- temp/ecs/config/clean-code.neon
- temp/ecs/config/psr2.neon
- temp/ecs/config/common.neon
parameters:
exclude_checkers:
# from temp/ecs/config/common.neon
- PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer
- PhpCsFixer\Fixer\PhpUnit\PhpUnitStrictFixer
- PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer
# from temp/ecs/config/spaces.neon
- PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer
skip:
PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\CamelCapsFunctionNameSniff:
- */tests/**

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpunit" version="^6.5.5" installed="6.5.5" location="./tools/phpunit"/>
<phar name="phpstan" version="^0.9.1" installed="0.9.1" location="./tools/phpstan"/>
</phive>

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ruleset
name="ProxyManager rules"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"
>
<rule ref="rulesets/codesize.xml"/>
<rule ref="rulesets/unusedcode.xml"/>
<rule ref="rulesets/design.xml">
<!-- eval is needed to generate runtime classes -->
<exclude name="EvalExpression"/>
</rule>
<rule ref="rulesets/naming.xml">
<exclude name="LongVariable"/>
</rule>
<rule ref="rulesets/naming.xml/LongVariable">
<properties>
<property name="minimum">40</property>
</properties>
</rule>
</ruleset>

View File

View File

@ -0,0 +1,54 @@
build: false
clone_folder: c:\reflectiondocblock
max_jobs: 3
platform: x86
pull_requests:
do_not_increment_build_number: true
version: '{build}.{branch}'
skip_tags: true
branches:
only:
- master
environment:
matrix:
- php_ver_target: 7.1
- php_ver_target: 7.2
matrix:
fast_finish: false
cache:
- c:\php -> appveyor.yml
- '%LOCALAPPDATA%\Composer\files'
init:
- SET PATH=C:\Program Files\OpenSSL;c:\tools\php;%PATH%
- SET COMPOSER_NO_INTERACTION=1
- SET PHP=1
- SET ANSICON=121x90 (121x90)
install:
- IF EXIST c:\tools\php (SET PHP=0)
- ps: appveyor-retry cinst --params '""/InstallDir:C:\tools\php""' --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $env:php_ver_target | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','')
- cd c:\tools\php
- IF %PHP%==1 copy /Y php.ini-development php.ini
- IF %PHP%==1 echo max_execution_time=1200 >> php.ini
- IF %PHP%==1 echo date.timezone="UTC" >> php.ini
- IF %PHP%==1 echo extension_dir=ext >> php.ini
- IF %PHP%==1 echo extension=php_curl.dll >> php.ini
- IF %PHP%==1 echo extension=php_openssl.dll >> php.ini
- IF %PHP%==1 echo extension=php_mbstring.dll >> php.ini
- IF %PHP%==1 echo extension=php_fileinfo.dll >> php.ini
- IF %PHP%==1 echo zend.assertions=1 >> php.ini
- IF %PHP%==1 echo assert.exception=On >> php.ini
- IF %PHP%==1 echo @php %%~dp0composer.phar %%* > composer.bat
- appveyor-retry appveyor DownloadFile https://getcomposer.org/composer.phar
- cd c:\reflectiondocblock
- composer install --no-interaction --prefer-dist --no-progress
- composer global require phpunit/phpunit ^6
- composer global config bin-dir --absolute
test_script:
- cd c:\reflectiondocblock
- c:\Users\appveyor\AppData\Roaming\Composer\vendor\bin\phpunit --no-coverage

View File

@ -0,0 +1,35 @@
on: push
name: Qa workflow
jobs:
composer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: composer
uses: docker://composer
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: install --no-interaction --prefer-dist --optimize-autoloader
- name: Code style check
uses: docker://phpdoc/phpcs-ga:master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: -d memory_limit=1024M -s
- name: composer-require-checker
uses: docker://phpga/composer-require-checker-ga
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: check --config-file ./composer-require-config.json composer.json
- name: Psalm
uses: docker://mickaelandrieu/psalm-ga
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: PHPStan
uses: docker://oskarstark/phpstan-ga
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: analyse src tests --level max --configuration phpstan.neon

View File

@ -0,0 +1,52 @@
build: false
clone_folder: c:\typeresolver
max_jobs: 3
platform: x86
pull_requests:
do_not_increment_build_number: true
version: '{build}.{branch}'
skip_tags: true
branches:
only:
- master
environment:
matrix:
- php_ver_target: 7.1
- php_ver_target: 7.2
matrix:
fast_finish: false
cache:
- c:\php -> appveyor.yml
- '%LOCALAPPDATA%\Composer\files'
init:
- SET PATH=C:\Program Files\OpenSSL;c:\tools\php;%PATH%
- SET COMPOSER_NO_INTERACTION=1
- SET PHP=1
- SET ANSICON=121x90 (121x90)
install:
- IF EXIST c:\tools\php (SET PHP=0)
- ps: appveyor-retry cinst --params '""/InstallDir:C:\tools\php""' --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $env:php_ver_target | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','')
- cd c:\tools\php
- IF %PHP%==1 copy /Y php.ini-development php.ini
- IF %PHP%==1 echo max_execution_time=1200 >> php.ini
- IF %PHP%==1 echo date.timezone="UTC" >> php.ini
- IF %PHP%==1 echo extension_dir=ext >> php.ini
- IF %PHP%==1 echo extension=php_curl.dll >> php.ini
- IF %PHP%==1 echo extension=php_openssl.dll >> php.ini
- IF %PHP%==1 echo extension=php_mbstring.dll >> php.ini
- IF %PHP%==1 echo extension=php_fileinfo.dll >> php.ini
- IF %PHP%==1 echo zend.assertions=1 >> php.ini
- IF %PHP%==1 echo assert.exception=On >> php.ini
- IF %PHP%==1 echo @php %%~dp0composer.phar %%* > composer.bat
- appveyor-retry appveyor DownloadFile https://getcomposer.org/composer.phar
- cd c:\typeresolver
- composer install --no-interaction --prefer-dist --no-progress
test_script:
- cd c:\typeresolver
- vendor\bin\phpunit --no-coverage

View File

@ -0,0 +1,15 @@
{
"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"
]
}

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpunit" version="^6.5.5" installed="6.5.11" location="./tools/phpunit"/>
<phar name="phpstan" version="^0.9.1" installed="0.10.2" location="./tools/phpstan"/>
</phive>

View File

@ -0,0 +1,30 @@
<?xml version="1.0"?>
<ruleset name="phpDocumentor">
<description>The coding standard for phpDocumentor.</description>
<file>src</file>
<file>tests/unit</file>
<exclude-pattern>*/tests/unit/Types/ContextFactoryTest.php</exclude-pattern>
<arg value="p"/>
<rule ref="PSR2">
<include-pattern>*\.php</include-pattern>
</rule>
<rule ref="Doctrine">
<exclude name="SlevomatCodingStandard.TypeHints.UselessConstantTypeHint.UselessDocComment" />
</rule>
<rule ref="Squiz.Classes.ValidClassName.NotCamelCaps">
<exclude-pattern>*/src/*_.php</exclude-pattern>
</rule>
<rule ref="SlevomatCodingStandard.Classes.SuperfluousAbstractClassNaming.SuperfluousPrefix">
<exclude-pattern>*/src/*/Abstract*.php</exclude-pattern>
</rule>
<rule ref="Generic.Formatting.SpaceAfterNot">
<properties>
<property name="spacing" value="0" />
</properties>
</rule>
</ruleset>

View File

@ -0,0 +1,7 @@
parameters:
ignoreErrors:
-
message: '#Parameter \#1 \$types of class phpDocumentor\\Reflection\\Types\\Compound constructor expects array<phpDocumentor\\Reflection\\Type>, array<int, string> given\.#'
path: %currentWorkingDirectory%/tests/unit/Types/CompoundTest.php
- message: '#Parameter \#2 \$fileContents of method phpDocumentor\\Reflection\\Types\\ContextFactory::createForNamespace\(\) expects string, string|false given\.#'
path: %currentWorkingDirectory%/tests/unit/Types/ContextFactoryTest.php

View File

@ -0,0 +1,18 @@
<?xml version="1.0"?>
<psalm
totallyTyped="false"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config file:///composer/vendor/vimeo/psalm/config.xsd"
>
<projectFiles>
<directory name="src" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
<issueHandlers>
<LessSpecificReturnType errorLevel="info" />
</issueHandlers>
</psalm>

View File

@ -0,0 +1,85 @@
<?php
declare(strict_types=1);
/**
* This file is part of phpDocumentor.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @link http://phpdoc.org
*/
namespace phpDocumentor\Reflection\Types;
use phpDocumentor\Reflection\Type;
/**
* Represents a list of values. This is an abstract class for Array_ and Collection.
*/
abstract class AbstractList implements Type
{
/** @var Type */
protected $valueType;
/** @var Type|null */
protected $keyType;
/** @var Type */
protected $defaultKeyType;
/**
* Initializes this representation of an array with the given Type.
*/
public function __construct(?Type $valueType = null, ?Type $keyType = null)
{
if ($valueType === null) {
$valueType = new Mixed_();
}
$this->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
{
if ($this->keyType === null) {
return $this->defaultKeyType;
}
return $this->keyType;
}
/**
* 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 . '[]';
}
}

View File

@ -0,0 +1,66 @@
<?php
declare(strict_types=1);
/**
* This file is part of phpDocumentor.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @link http://phpdoc.org
*/
namespace phpDocumentor\Reflection\Types;
use phpDocumentor\Reflection\Fqsen;
use phpDocumentor\Reflection\Type;
/**
* Represents a collection type as described in the PSR-5, the PHPDoc Standard.
*
* A collection can be represented in two forms:
*
* 1. `ACollectionObject<aValueType>`
* 2. `ACollectionObject<aValueType,aKeyType>`
*
* - ACollectionObject can be 'array' or an object that can act as an array
* - aValueType and aKeyType can be any type expression
*/
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 . '>';
}
}

View File

@ -0,0 +1 @@
*.php diff=php

View File

@ -0,0 +1 @@
Please refer to [https://github.com/sebastianbergmann/phpunit/blob/master/CONTRIBUTING.md](https://github.com/sebastianbergmann/phpunit/blob/master/CONTRIBUTING.md) for details on how to contribute to this project.

View File

@ -0,0 +1,18 @@
| 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
<!--
- Please fill in this template according to your issue.
- Please keep the table shown above at the top of your issue.
- Please post code as text (using proper markup). Do not post screenshots of code.
- For support request or how-tos, visit https://phpunit.de/support.html
- Otherwise, replace this comment by the description of your issue.
-->

View File

@ -0,0 +1,6 @@
/tests/_files/tmp
/vendor
/composer.lock
/.idea
/.php_cs.cache

View File

@ -0,0 +1,69 @@
<?php
$finder = Symfony\CS\Finder\DefaultFinder::create()
->files()
->in('src')
->in('tests')
->exclude('_files')
->name('*.php');
return Symfony\CS\Config\Config::create()
->setUsingCache(true)
->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);

View File

@ -0,0 +1,42 @@
language: php
php:
- 5.6
- 7.0
- 7.0snapshot
- 7.1
- 7.1snapshot
- master
env:
matrix:
- DRIVER="xdebug"
- DRIVER="phpdbg"
matrix:
allow_failures:
- php: master
fast_finish: true
exclude:
- php: 5.6
env: DRIVER="phpdbg"
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:
- if [[ "$DRIVER" = 'phpdbg' ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml; fi
- if [[ "$DRIVER" = 'xdebug' ]]; then vendor/bin/phpunit --coverage-clover=coverage.xml; fi
after_success:
- bash <(curl -s https://codecov.io/bash)
notifications:
email: false

View File

@ -0,0 +1,56 @@
# Changes in PHP_CodeCoverage 2.2
All notable changes of the PHP_CodeCoverage 2.2 release series are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
## [2.2.4] - 2015-10-06
### Fixed
* Fixed [#391](https://github.com/sebastianbergmann/php-code-coverage/pull/391): Missing `</abbr>` tag
## [2.2.3] - 2015-09-14
### Fixed
* Fixed [#368](https://github.com/sebastianbergmann/php-code-coverage/pull/368): Blacklists and whitelists are not merged when merging data sets
* Fixed [#370](https://github.com/sebastianbergmann/php-code-coverage/issues/370): Confusing statistics for source file that declares a class without methods
* Fixed [#372](https://github.com/sebastianbergmann/php-code-coverage/pull/372): Nested classes and functions are not handled correctly
* Fixed [#382](https://github.com/sebastianbergmann/php-code-coverage/issues/382): Crap4J report generates incorrect XML logfile
## [2.2.2] - 2015-08-04
### Added
* Reintroduced the `PHP_CodeCoverage_Driver_HHVM` driver as an extension of `PHP_CodeCoverage_Driver_Xdebug` that does not use `xdebug_start_code_coverage()` with options not supported by HHVM
### Changed
* Bumped required version of `sebastian/environment` to 1.3.2 for [#365](https://github.com/sebastianbergmann/php-code-coverage/issues/365)
## [2.2.1] - 2015-08-02
### Changed
* Bumped required version of `sebastian/environment` to 1.3.1 for [#365](https://github.com/sebastianbergmann/php-code-coverage/issues/365)
## [2.2.0] - 2015-08-01
### Added
* Added a driver for PHPDBG (requires PHP 7)
* Added `PHP_CodeCoverage::setDisableIgnoredLines()` to disable the ignoring of lines using annotations such as `@codeCoverageIgnore`
### Changed
* Annotating a method with `@deprecated` now has the same effect as annotating it with `@codeCoverageIgnore`
### Removed
* The dedicated driver for HHVM, `PHP_CodeCoverage_Driver_HHVM` has been removed
[2.2.4]: https://github.com/sebastianbergmann/php-code-coverage/compare/2.2.3...2.2.4
[2.2.3]: https://github.com/sebastianbergmann/php-code-coverage/compare/2.2.2...2.2.3
[2.2.2]: https://github.com/sebastianbergmann/php-code-coverage/compare/2.2.1...2.2.2
[2.2.1]: https://github.com/sebastianbergmann/php-code-coverage/compare/2.2.0...2.2.1
[2.2.0]: https://github.com/sebastianbergmann/php-code-coverage/compare/2.1...2.2.0

View File

@ -0,0 +1,31 @@
# Changes in PHP_CodeCoverage 3.0
All notable changes of the PHP_CodeCoverage 3.0 release series are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
## [3.0.2] - 2015-11-12
### Changed
* It is now optional that `@deprecated` code is ignored
## [3.0.1] - 2015-10-06
### Fixed
* Fixed [#391](https://github.com/sebastianbergmann/php-code-coverage/pull/391): Missing `</abbr>` tag
## [3.0.0] - 2015-10-02
### Changed
* It is now mandatory to configure a whitelist
### Removed
* The blacklist functionality has been removed
* PHP_CodeCoverage is no longer supported on PHP 5.3, PHP 5.4, and PHP 5.5
[3.0.2]: https://github.com/sebastianbergmann/php-code-coverage/compare/3.0.1...3.0.2
[3.0.1]: https://github.com/sebastianbergmann/php-code-coverage/compare/3.0.0...3.0.1
[3.0.0]: https://github.com/sebastianbergmann/php-code-coverage/compare/2.2...3.0.0

View File

@ -0,0 +1,30 @@
# Changes in PHP_CodeCoverage 3.1
All notable changes of the PHP_CodeCoverage 3.1 release series are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
## [3.1.1] - 2016-02-04
### Changed
* Allow version 2.0.x of `sebastian/version` dependency
## [3.1.0] - 2016-01-11
### Added
* Implemented [#234](https://github.com/sebastianbergmann/php-code-coverage/issues/234): Optionally raise an exception when a specified unit of code is not executed
### Changed
* The Clover XML report now contains cyclomatic complexity information
* The Clover XML report now contains method visibility information
* Cleanup and refactoring of various areas of code
* Added missing test cases
### Removed
* The functionality controlled by the `mapTestClassNameToCoveredClassName` setting has been removed
[3.1.1]: https://github.com/sebastianbergmann/php-code-coverage/compare/3.1.0...3.1.1
[3.1.0]: https://github.com/sebastianbergmann/php-code-coverage/compare/3.0...3.1.0

View File

@ -0,0 +1,23 @@
# Changes in PHP_CodeCoverage 3.2
All notable changes of the PHP_CodeCoverage 3.2 release series are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
## [3.2.1] - 2016-02-18
### Changed
* Updated dependency information in `composer.json`
## [3.2.0] - 2016-02-13
### Added
* Added optional check for missing `@covers` annotation when the usage of `@covers` annotations is forced
### Changed
* Improved `PHP_CodeCoverage_UnintentionallyCoveredCodeException` message
[3.2.1]: https://github.com/sebastianbergmann/php-code-coverage/compare/3.2.0...3.2.1
[3.2.0]: https://github.com/sebastianbergmann/php-code-coverage/compare/3.1...3.2.0

View File

@ -0,0 +1,33 @@
# Changes in PHP_CodeCoverage 3.3
All notable changes of the PHP_CodeCoverage 3.3 release series are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
## [3.3.3] - 2016-MM-DD
### Fixed
* Fixed [#438](https://github.com/sebastianbergmann/php-code-coverage/issues/438): Wrong base directory for Clover reports
## [3.3.2] - 2016-05-25
### Changed
* The constructor of `PHP_CodeCoverage_Report_Text` now has default values for its parameters
## [3.3.1] - 2016-04-08
### Fixed
* Fixed handling of lines that contain `declare` statements
## [3.3.0] - 2016-03-03
### Added
* Added support for whitelisting classes for the unintentionally covered code unit check
[3.3.3]: https://github.com/sebastianbergmann/php-code-coverage/compare/3.3.2...3.3.3
[3.3.2]: https://github.com/sebastianbergmann/php-code-coverage/compare/3.3.1...3.3.2
[3.3.1]: https://github.com/sebastianbergmann/php-code-coverage/compare/3.3.0...3.3.1
[3.3.0]: https://github.com/sebastianbergmann/php-code-coverage/compare/3.2...3.3.0

View File

@ -0,0 +1,67 @@
# Changes in PHP_CodeCoverage 4.0
All notable changes of the PHP_CodeCoverage 4.0 release series are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
## [4.0.8] - 2017-04-02
* Fixed [#515](https://github.com/sebastianbergmann/php-code-coverage/pull/515): Wrong use of recursive iterator causing duplicate entries in XML coverage report
## [4.0.7] - 2017-03-01
### Changed
* Cleaned up requirements in `composer.json`
## [4.0.6] - 2017-02-23
### Changed
* Added support for `phpunit/php-token-stream` 2.0
* Updated HTML report assets
## [4.0.5] - 2017-01-20
### Fixed
* Fixed formatting of executed lines percentage for classes in file view
## [4.0.4] - 2016-12-20
### Changed
* Implemented [#432](https://github.com/sebastianbergmann/php-code-coverage/issues/432): Change how files with no executable lines are displayed in the HTML report
## [4.0.3] - 2016-11-28
### Changed
* The check for unintentionally covered code is no longer performed for `@medium` and `@large` tests
## [4.0.2] - 2016-11-01
### Fixed
* Fixed [#440](https://github.com/sebastianbergmann/php-code-coverage/pull/440): Dashboard charts not showing tooltips for data points
## [4.0.1] - 2016-07-26
### Fixed
* Fixed [#458](https://github.com/sebastianbergmann/php-code-coverage/pull/458): XML report does not know about warning status
## [4.0.0] - 2016-06-03
### Changed
* This component now uses namespaces
[4.0.8]: https://github.com/sebastianbergmann/php-code-coverage/compare/4.0.7...4.0.8
[4.0.7]: https://github.com/sebastianbergmann/php-code-coverage/compare/4.0.6...4.0.7
[4.0.6]: https://github.com/sebastianbergmann/php-code-coverage/compare/4.0.5...4.0.6
[4.0.5]: https://github.com/sebastianbergmann/php-code-coverage/compare/4.0.4...4.0.5
[4.0.4]: https://github.com/sebastianbergmann/php-code-coverage/compare/4.0.3...4.0.4
[4.0.3]: https://github.com/sebastianbergmann/php-code-coverage/compare/4.0.2...4.0.3
[4.0.2]: https://github.com/sebastianbergmann/php-code-coverage/compare/4.0.1...4.0.2
[4.0.1]: https://github.com/sebastianbergmann/php-code-coverage/compare/4.0.0...4.0.1
[4.0.0]: https://github.com/sebastianbergmann/php-code-coverage/compare/3.3...4.0.0

View File

@ -0,0 +1,33 @@
PHP_CodeCoverage
Copyright (c) 2009-2015, Sebastian Bergmann <sebastian@phpunit.de>.
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.

View File

@ -0,0 +1,51 @@
[![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)
# PHP_CodeCoverage
**PHP_CodeCoverage** is a library that provides collection, processing, and rendering functionality for PHP code coverage information.
## Requirements
PHP 5.6 is required but using the latest version of PHP is highly recommended.
### PHP 5
[Xdebug](http://xdebug.org/) is the only source of raw code coverage data supported for PHP 5. Version 2.2.1 of Xdebug is required but using the latest version is highly recommended.
### PHP 7
Version 2.4.0 (or later) of [Xdebug](http://xdebug.org/) as well as [phpdbg](http://phpdbg.com/docs) are supported sources of raw code coverage data for PHP 7.
### HHVM
A version of HHVM that implements the Xdebug API for code coverage (`xdebug_*_code_coverage()`) is required.
## 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 PHP_CodeCoverage API
```php
<?php
$coverage = new \SebastianBergmann\CodeCoverage\CodeCoverage;
$coverage->start('<name of test>');
// ...
$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');
```

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="php-code-coverage" default="setup">
<target name="setup" depends="clean,composer"/>
<target name="clean" description="Cleanup build artifacts">
<delete dir="${basedir}/vendor"/>
<delete file="${basedir}/composer.lock"/>
</target>
<target name="composer" depends="clean" description="Install dependencies with Composer">
<exec executable="composer" taskname="composer">
<arg value="update"/>
<arg value="--no-interaction"/>
<arg value="--no-progress"/>
<arg value="--no-ansi"/>
<arg value="--no-suggest"/>
<arg value="--optimize-autoloader"/>
<arg value="--prefer-stable"/>
</exec>
</target>
</project>

View File

@ -0,0 +1,51 @@
{
"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": "sb@sebastian-bergmann.de",
"role": "lead"
}
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"irc": "irc://irc.freenode.net/phpunit"
},
"require": {
"php": "^5.6 || ^7.0",
"ext-dom": "*",
"ext-xmlwriter": "*",
"phpunit/php-file-iterator": "^1.3",
"phpunit/php-token-stream": "^1.4.2 || ^2.0",
"phpunit/php-text-template": "^1.2",
"sebastian/code-unit-reverse-lookup": "^1.0",
"sebastian/environment": "^1.3.2 || ^2.0",
"sebastian/version": "^1.0 || ^2.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7",
"ext-xdebug": "^2.1.4"
},
"suggest": {
"ext-xdebug": "^2.5.1"
},
"autoload": {
"classmap": [
"src/"
]
},
"extra": {
"branch-alias": {
"dev-master": "4.0.x-dev"
}
}
}

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/5.7/phpunit.xsd"
bootstrap="tests/bootstrap.php"
backupGlobals="false"
verbose="true">
<testsuite>
<directory suffix="Test.php">tests/tests</directory>
</testsuite>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>
<php>
<ini name="serialize_precision" value="14"/>
</php>
</phpunit>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,52 @@
<?php
/*
* This file is part of the php-code-coverage package.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* 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
*/
const LINE_EXECUTED = 1;
/**
* @var int
*
* @see http://xdebug.org/docs/code_coverage
*/
const LINE_NOT_EXECUTED = -1;
/**
* @var int
*
* @see http://xdebug.org/docs/code_coverage
*/
const LINE_NOT_EXECUTABLE = -2;
/**
* Start collection of code coverage information.
*
* @param bool $determineUnusedAndDead
*/
public function start($determineUnusedAndDead = true);
/**
* Stop collection of code coverage information.
*
* @return array
*/
public function stop();
}

View File

@ -0,0 +1,29 @@
<?php
/*
* This file is part of the php-code-coverage package.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* 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 HHVM's code coverage functionality.
*
* @codeCoverageIgnore
*/
class HHVM extends Xdebug
{
/**
* Start collection of code coverage information.
*
* @param bool $determineUnusedAndDead
*/
public function start($determineUnusedAndDead = true)
{
xdebug_start_code_coverage();
}
}

View File

@ -0,0 +1,111 @@
<?php
/*
* This file is part of the php-code-coverage package.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* 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
*/
class PHPDBG implements Driver
{
/**
* Constructor.
*/
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.
*
* @param bool $determineUnusedAndDead
*/
public function start($determineUnusedAndDead = true)
{
phpdbg_start_oplog();
}
/**
* Stop collection of code coverage information.
*
* @return array
*/
public function stop()
{
static $fetchedLines = [];
$dbgData = phpdbg_end_oplog();
if ($fetchedLines == []) {
$sourceLines = phpdbg_get_executable();
} else {
$newFiles = array_diff(
get_included_files(),
array_keys($fetchedLines)
);
if ($newFiles) {
$sourceLines = phpdbg_get_executable(
['files' => $newFiles]
);
} else {
$sourceLines = [];
}
}
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
*
* @param array $sourceLines
* @param array $dbgData
*
* @return array
*/
private function detectExecutedLines(array $sourceLines, array $dbgData)
{
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;
}
}

View File

@ -0,0 +1,117 @@
<?php
/*
* This file is part of the php-code-coverage package.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* 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 Xdebug's code coverage functionality.
*
* @codeCoverageIgnore
*/
class Xdebug implements Driver
{
/**
* Cache the number of lines for each file
*
* @var array
*/
private $cacheNumLines = [];
/**
* Constructor.
*/
public function __construct()
{
if (!extension_loaded('xdebug')) {
throw new RuntimeException('This driver requires Xdebug');
}
if (version_compare(phpversion('xdebug'), '2.2.1', '>=') &&
!ini_get('xdebug.coverage_enable')) {
throw new RuntimeException(
'xdebug.coverage_enable=On has to be set in php.ini'
);
}
}
/**
* Start collection of code coverage information.
*
* @param bool $determineUnusedAndDead
*/
public function start($determineUnusedAndDead = true)
{
if ($determineUnusedAndDead) {
xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);
} else {
xdebug_start_code_coverage();
}
}
/**
* Stop collection of code coverage information.
*
* @return array
*/
public function stop()
{
$data = xdebug_get_code_coverage();
xdebug_stop_code_coverage();
return $this->cleanup($data);
}
/**
* @param array $data
*
* @return array
*/
private function cleanup(array $data)
{
foreach (array_keys($data) as $file) {
unset($data[$file][0]);
if (strpos($file, 'xdebug://debug-eval') !== 0 && file_exists($file)) {
$numLines = $this->getNumberOfLinesInFile($file);
foreach (array_keys($data[$file]) as $line) {
if ($line > $numLines) {
unset($data[$file][$line]);
}
}
}
}
return $data;
}
/**
* @param string $file
*
* @return int
*/
private function getNumberOfLinesInFile($file)
{
if (!isset($this->cacheNumLines[$file])) {
$buffer = file_get_contents($file);
$lines = substr_count($buffer, "\n");
if (substr($buffer, -1) !== "\n") {
$lines++;
}
$this->cacheNumLines[$file] = $lines;
}
return $this->cacheNumLines[$file];
}
}

View File

@ -0,0 +1,18 @@
<?php
/*
* This file is part of the php-code-coverage package.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* 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.
*/
class CoveredCodeNotExecutedException extends RuntimeException
{
}

View File

@ -0,0 +1,18 @@
<?php
/*
* This file is part of the php-code-coverage package.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* 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
{
}

View File

@ -0,0 +1,37 @@
<?php
/*
* This file is part of the php-code-coverage package.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace SebastianBergmann\CodeCoverage;
class InvalidArgumentException extends \InvalidArgumentException implements Exception
{
/**
* @param int $argument
* @param string $type
* @param mixed $value
*
* @return InvalidArgumentException
*/
public static function create($argument, $type, $value = null)
{
$stack = debug_backtrace(0);
return new self(
sprintf(
'Argument #%d%sof %s::%s() must be a %s',
$argument,