Skip to content

Commit

Permalink
Merge pull request #4 from idealo/add-code-climate
Browse files Browse the repository at this point in the history
add code climate config
  • Loading branch information
dirx authored May 25, 2018
2 parents d8c85b9 + d6a2cf2 commit 0002495
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 8 deletions.
23 changes: 23 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: "2"
plugins:
duplication:
enabled: true
config:
languages:
- php
fixme:
enabled: true
phpcodesniffer:
enabled: true
config:
standard: "PSR2"
phan:
enabled: true
config:
file_extensions: "php"
ignore-undeclared: true
sonar-php:
enabled: true
exclude_patterns:
- tests/
- .phan/
17 changes: 17 additions & 0 deletions .phan/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

$config = [
'target_php_version' => null,
'directory_list' => [
'src',
],
'exclude_analysis_directory_list' => [],
];

// workaround for phan on codeclimate
if (file_exists(dirname(__DIR__) . '/vendor/psr')) {
$config['directory_list'] [] = 'vendor/psr';
$config['exclude_analysis_directory_list'] [] = 'vendor/';
}

return $config;
16 changes: 13 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
env:
global:
- CC_TEST_REPORTER_ID=4796fc8abec9f60231051df2c2523b62c6f650137be5458aada65a7bbc79e6aa
language: php
php:
- '7.0'
- '7.1'
- '7.2'

before_script: composer install
script: phpunit
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- if [ $(phpenv version-name) = "7.2" ]; then ./cc-test-reporter before-build; fi
install:
- composer install
script:
- phpunit --coverage-text --coverage-clover clover.xml
after_script:
- if [ $(phpenv version-name) = "7.2" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi
2 changes: 2 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# PHP Middleware Stack
[![Build Status](https://travis-ci.org/idealo/php-middleware-stack.svg?branch=master)](https://travis-ci.org/idealo/php-middleware-stack)
[![Maintainability](https://api.codeclimate.com/v1/badges/254d91c39447f58c7d44/maintainability)](https://codeclimate.com/github/idealo/php-middleware-stack/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/254d91c39447f58c7d44/test_coverage)](https://codeclimate.com/github/idealo/php-middleware-stack/test_coverage)

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.

Expand Down
4 changes: 2 additions & 2 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.5/phpunit.xsd"
backupGlobals="true"
backupStaticAttributes="false"
bootstrap="tests/bootstrap.php"
bootstrap="vendor/autoload.php"
cacheTokens="false"
colors="true"
verbose="true">
<testsuites>
<testsuite name="Middleware Stack Test Coverage">
<testsuite name="unit">
<directory>tests</directory>
</testsuite>
</testsuites>
Expand Down
3 changes: 0 additions & 3 deletions tests/bootstrap.php

This file was deleted.

0 comments on commit 0002495

Please sign in to comment.