Skip to content

Commit 0002495

Browse files
authored
Merge pull request #4 from idealo/add-code-climate
add code climate config
2 parents d8c85b9 + d6a2cf2 commit 0002495

File tree

6 files changed

+57
-8
lines changed

6 files changed

+57
-8
lines changed

.codeclimate.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
version: "2"
2+
plugins:
3+
duplication:
4+
enabled: true
5+
config:
6+
languages:
7+
- php
8+
fixme:
9+
enabled: true
10+
phpcodesniffer:
11+
enabled: true
12+
config:
13+
standard: "PSR2"
14+
phan:
15+
enabled: true
16+
config:
17+
file_extensions: "php"
18+
ignore-undeclared: true
19+
sonar-php:
20+
enabled: true
21+
exclude_patterns:
22+
- tests/
23+
- .phan/

.phan/config.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
$config = [
4+
'target_php_version' => null,
5+
'directory_list' => [
6+
'src',
7+
],
8+
'exclude_analysis_directory_list' => [],
9+
];
10+
11+
// workaround for phan on codeclimate
12+
if (file_exists(dirname(__DIR__) . '/vendor/psr')) {
13+
$config['directory_list'] [] = 'vendor/psr';
14+
$config['exclude_analysis_directory_list'] [] = 'vendor/';
15+
}
16+
17+
return $config;

.travis.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1+
env:
2+
global:
3+
- CC_TEST_REPORTER_ID=4796fc8abec9f60231051df2c2523b62c6f650137be5458aada65a7bbc79e6aa
14
language: php
25
php:
36
- '7.0'
47
- '7.1'
58
- '7.2'
6-
7-
before_script: composer install
8-
script: phpunit
9+
before_script:
10+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
11+
- chmod +x ./cc-test-reporter
12+
- if [ $(phpenv version-name) = "7.2" ]; then ./cc-test-reporter before-build; fi
13+
install:
14+
- composer install
15+
script:
16+
- phpunit --coverage-text --coverage-clover clover.xml
17+
after_script:
18+
- if [ $(phpenv version-name) = "7.2" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi

Readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# PHP Middleware Stack
22
[![Build Status](https://travis-ci.org/idealo/php-middleware-stack.svg?branch=master)](https://travis-ci.org/idealo/php-middleware-stack)
3+
[![Maintainability](https://api.codeclimate.com/v1/badges/254d91c39447f58c7d44/maintainability)](https://codeclimate.com/github/idealo/php-middleware-stack/maintainability)
4+
[![Test Coverage](https://api.codeclimate.com/v1/badges/254d91c39447f58c7d44/test_coverage)](https://codeclimate.com/github/idealo/php-middleware-stack/test_coverage)
35

46
This is an implementation of [PSR-15](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-15-request-handlers.md) using the proposed Interface packages [psr/http-server-middleware](https://github.com/php-fig/http-server-middleware) and [psr/http-server-handler](https://github.com/php-fig/http-server-handler) for PHP7+ runtime environment.
57

phpunit.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.5/phpunit.xsd"
44
backupGlobals="true"
55
backupStaticAttributes="false"
6-
bootstrap="tests/bootstrap.php"
6+
bootstrap="vendor/autoload.php"
77
cacheTokens="false"
88
colors="true"
99
verbose="true">
1010
<testsuites>
11-
<testsuite name="Middleware Stack Test Coverage">
11+
<testsuite name="unit">
1212
<directory>tests</directory>
1313
</testsuite>
1414
</testsuites>

tests/bootstrap.php

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)