Use Scrutinizer instead of Coveralls
This commit is contained in:
parent
ad6b881685
commit
0adbf439f5
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,6 +1,5 @@
|
|||||||
/tests/resources/generated
|
/tests/resources/generated
|
||||||
/tests/coverage
|
/tests/coverage
|
||||||
/vendor
|
/vendor
|
||||||
composer.lock
|
|
||||||
/.idea
|
/.idea
|
||||||
*.iml
|
*.iml
|
||||||
|
54
.scrutinizer.yml
Normal file
54
.scrutinizer.yml
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
filter:
|
||||||
|
excluded_paths: [vendor/*, tests/*]
|
||||||
|
|
||||||
|
tools:
|
||||||
|
external_code_coverage:
|
||||||
|
timeout: 600 # Wait 10 minutes for results
|
||||||
|
runs: 3 # Merge results for 5.4, 5.5 and 5.6 jobs
|
||||||
|
php_mess_detector: true
|
||||||
|
php_code_sniffer:
|
||||||
|
config:
|
||||||
|
standard: PSR4
|
||||||
|
filter:
|
||||||
|
paths: ['src']
|
||||||
|
sensiolabs_security_checker: true
|
||||||
|
php_pdepend: true
|
||||||
|
php_loc:
|
||||||
|
enabled: true
|
||||||
|
excluded_dirs: [vendor, tests]
|
||||||
|
php_cpd:
|
||||||
|
enabled: true
|
||||||
|
excluded_dirs: [vendor, tests]
|
||||||
|
|
||||||
|
build_failure_conditions:
|
||||||
|
- 'project.metric("scrutinizer.quality", < 9)' # Code Quality Rating drops below 9
|
||||||
|
- 'project.metric_change("scrutinizer.test_coverage", < -0.005)' # Code Coverage decreased by more than 0.5%
|
||||||
|
- 'project.metric("scrutinizer.test_coverage", < 0.97)' # Code Coverage drops below 97%
|
||||||
|
|
||||||
|
checks:
|
||||||
|
php:
|
||||||
|
remove_extra_empty_lines: true
|
||||||
|
remove_php_closing_tag: true
|
||||||
|
remove_trailing_whitespace: true
|
||||||
|
fix_use_statements:
|
||||||
|
remove_unused: true
|
||||||
|
preserve_multiple: false
|
||||||
|
preserve_blanklines: true
|
||||||
|
fix_php_opening_tag: true
|
||||||
|
fix_linefeed: true
|
||||||
|
fix_line_ending: true
|
||||||
|
fix_identation_4spaces: true
|
||||||
|
fix_doc_comments: true
|
||||||
|
uppercase_constants: true
|
||||||
|
use_self_instead_of_fqcn: true
|
||||||
|
simplify_boolean_return: true
|
||||||
|
return_doc_comments: true
|
||||||
|
return_doc_comment_if_not_inferrable: true
|
||||||
|
phpunit_assertions: true
|
||||||
|
parameters_in_camelcaps: true
|
||||||
|
parameter_doc_comments: true
|
||||||
|
param_doc_comment_if_not_inferrable: true
|
||||||
|
optional_parameters_at_the_end: true
|
||||||
|
newline_at_end_of_file: true
|
||||||
|
encourage_single_quotes: true
|
||||||
|
|
@ -4,15 +4,15 @@ php:
|
|||||||
- 5.4
|
- 5.4
|
||||||
- 5.5
|
- 5.5
|
||||||
- 5.6
|
- 5.6
|
||||||
- nightly
|
- 7.0
|
||||||
- hhvm
|
- hhvm
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- composer install --no-interaction
|
- composer install --no-interaction --prefer-source
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- mkdir -p build/logs
|
- mkdir -p build/logs
|
||||||
- php vendor/bin/phpunit --coverage-clover build/logs/clover.xml
|
- php vendor/bin/phpunit --coverage-clover build/logs/clover.xml
|
||||||
|
|
||||||
after_script:
|
after_script:
|
||||||
- php vendor/bin/coveralls -v
|
- if [[ $TRAVIS_PHP_VERSION != 'hhvm' && $TRAVIS_PHP_VERSION != '7.0' ]]; then php vendor/bin/ocular code-coverage:upload --format=php-clover build/logs/clover.xml; fi
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
[](https://packagist.org/packages/box/spout)
|
[](https://packagist.org/packages/box/spout)
|
||||||
[](http://opensource.box.com/badges)
|
[](http://opensource.box.com/badges)
|
||||||
[](http://travis-ci.org/box/spout)
|
[](http://travis-ci.org/box/spout)
|
||||||
[](https://coveralls.io/r/box/spout?branch=master)
|
[](https://scrutinizer-ci.com/g/box/spout/?branch=master)
|
||||||
[](https://packagist.org/packages/box/spout)
|
[](https://packagist.org/packages/box/spout)
|
||||||
[](https://packagist.org/packages/box/spout)
|
[](https://packagist.org/packages/box/spout)
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": ">=3.7",
|
"phpunit/phpunit": ">=3.7",
|
||||||
"satooshi/php-coveralls": "^0.6.1"
|
"scrutinizer/ocular": "~1.1"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
1647
composer.lock
generated
Normal file
1647
composer.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -32,20 +32,20 @@ class Psr4Autoloader
|
|||||||
* Adds a base directory for a namespace prefix.
|
* Adds a base directory for a namespace prefix.
|
||||||
*
|
*
|
||||||
* @param string $prefix The namespace prefix.
|
* @param string $prefix The namespace prefix.
|
||||||
* @param string $base_dir A base directory for class files in the
|
* @param string $baseDir A base directory for class files in the
|
||||||
* namespace.
|
* namespace.
|
||||||
* @param bool $prepend If true, prepend the base directory to the stack
|
* @param bool $prepend If true, prepend the base directory to the stack
|
||||||
* instead of appending it; this causes it to be searched first rather
|
* instead of appending it; this causes it to be searched first rather
|
||||||
* than last.
|
* than last.
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function addNamespace($prefix, $base_dir, $prepend = false)
|
public function addNamespace($prefix, $baseDir, $prepend = false)
|
||||||
{
|
{
|
||||||
// normalize namespace prefix
|
// normalize namespace prefix
|
||||||
$prefix = trim($prefix, '\\') . '\\';
|
$prefix = trim($prefix, '\\') . '\\';
|
||||||
|
|
||||||
// normalize the base directory with a trailing separator
|
// normalize the base directory with a trailing separator
|
||||||
$base_dir = rtrim($base_dir, DIRECTORY_SEPARATOR) . '/';
|
$baseDir = rtrim($baseDir, DIRECTORY_SEPARATOR) . '/';
|
||||||
|
|
||||||
// initialize the namespace prefix array
|
// initialize the namespace prefix array
|
||||||
if (isset($this->prefixes[$prefix]) === false) {
|
if (isset($this->prefixes[$prefix]) === false) {
|
||||||
@ -54,9 +54,9 @@ class Psr4Autoloader
|
|||||||
|
|
||||||
// retain the base directory for the namespace prefix
|
// retain the base directory for the namespace prefix
|
||||||
if ($prepend) {
|
if ($prepend) {
|
||||||
array_unshift($this->prefixes[$prefix], $base_dir);
|
array_unshift($this->prefixes[$prefix], $baseDir);
|
||||||
} else {
|
} else {
|
||||||
array_push($this->prefixes[$prefix], $base_dir);
|
array_push($this->prefixes[$prefix], $baseDir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,12 +80,12 @@ class Psr4Autoloader
|
|||||||
$prefix = substr($class, 0, $pos + 1);
|
$prefix = substr($class, 0, $pos + 1);
|
||||||
|
|
||||||
// the rest is the relative class name
|
// the rest is the relative class name
|
||||||
$relative_class = substr($class, $pos + 1);
|
$relativeClass = substr($class, $pos + 1);
|
||||||
|
|
||||||
// try to load a mapped file for the prefix and relative class
|
// try to load a mapped file for the prefix and relative class
|
||||||
$mapped_file = $this->loadMappedFile($prefix, $relative_class);
|
$mappedFile = $this->loadMappedFile($prefix, $relativeClass);
|
||||||
if ($mapped_file) {
|
if ($mappedFile !== false) {
|
||||||
return $mapped_file;
|
return $mappedFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove the trailing namespace separator for the next iteration
|
// remove the trailing namespace separator for the next iteration
|
||||||
@ -101,11 +101,11 @@ class Psr4Autoloader
|
|||||||
* Load the mapped file for a namespace prefix and relative class.
|
* Load the mapped file for a namespace prefix and relative class.
|
||||||
*
|
*
|
||||||
* @param string $prefix The namespace prefix.
|
* @param string $prefix The namespace prefix.
|
||||||
* @param string $relative_class The relative class name.
|
* @param string $relativeClass The relative class name.
|
||||||
* @return mixed Boolean false if no mapped file can be loaded, or the
|
* @return mixed Boolean false if no mapped file can be loaded, or the
|
||||||
* name of the mapped file that was loaded.
|
* name of the mapped file that was loaded.
|
||||||
*/
|
*/
|
||||||
protected function loadMappedFile($prefix, $relative_class)
|
protected function loadMappedFile($prefix, $relativeClass)
|
||||||
{
|
{
|
||||||
// are there any base directories for this namespace prefix?
|
// are there any base directories for this namespace prefix?
|
||||||
if (isset($this->prefixes[$prefix]) === false) {
|
if (isset($this->prefixes[$prefix]) === false) {
|
||||||
@ -113,13 +113,13 @@ class Psr4Autoloader
|
|||||||
}
|
}
|
||||||
|
|
||||||
// look through base directories for this namespace prefix
|
// look through base directories for this namespace prefix
|
||||||
foreach ($this->prefixes[$prefix] as $base_dir) {
|
foreach ($this->prefixes[$prefix] as $baseDir) {
|
||||||
|
|
||||||
// replace the namespace prefix with the base directory,
|
// replace the namespace prefix with the base directory,
|
||||||
// replace namespace separators with directory separators
|
// replace namespace separators with directory separators
|
||||||
// in the relative class name, append with .php
|
// in the relative class name, append with .php
|
||||||
$file = $base_dir
|
$file = $baseDir
|
||||||
. str_replace('\\', '/', $relative_class)
|
. str_replace('\\', '/', $relativeClass)
|
||||||
. '.php';
|
. '.php';
|
||||||
|
|
||||||
// if the mapped file exists, require it
|
// if the mapped file exists, require it
|
||||||
|
Loading…
x
Reference in New Issue
Block a user