Skip to content
This repository was archived by the owner on Mar 30, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .bettercodehub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
component_depth: 1
languages:
- php
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
key: composer-v1-{{ checksum "composer.json" }}
paths:
- vendor
- run: vendor/bin/phpunit --colors --columns 121 --coverage-text
- run: vendor/bin/phpunit -c phpunit.xml --colors --columns 117 --coverage-clover=clover.xml --coverage-text
phpcs:
docker:
- image: circleci/php:7.1
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
key: composer-v1-{{ checksum "composer.json" }}
paths:
- vendor
- run: vendor/bin/phpstan analyse -l 7 -c phpstan.neon --autoload-file=vendor/autoload.php --memory-limit=768M --no-progress src tests
- run: vendor/bin/phpstan analyse -c phpstan.neon --memory-limit=768M --no-progress

workflows:
version: 2
Expand Down
6 changes: 6 additions & 0 deletions .codacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
engines:
phpcs:
enabled: true
phpmd:
enabled: false
86 changes: 41 additions & 45 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,53 @@
---
engines:
duplication:
enabled: true
version: "2"
checks:
argument-count:
config:
threshold: 4
complex-logic:
config:
threshold: 4
file-lines:
config:
threshold: 250
method-complexity:
config:
threshold: 5
method-count:
config:
threshold: 20
method-lines:
enabled: false
config:
threshold: 25
nested-control-flow:
config:
threshold: 4
return-statements:
enabled: false
config:
languages:
php:
mass_threshold: 40
checks:
Similar Code:
enabled: false
Identical code:
enabled: false
Similar code:
enabled: false
threshold: 4
similar-code:
enabled: false
config:
threshold: # language-specific defaults. an override will affect all languages.
identical-code:
enabled: false
config:
threshold: # language-specific defaults. an override will affect all languages.

plugins:
fixme:
enabled: true
phpmd:
enabled: true
config:
file_extensions: "php"
rulesets: "unusedcode,codesize,naming,cleancode"
checks:
Naming/ShortVariable:
enabled: false
Design/CouplingBetweenObjects:
enabled: false
Design/WeightedMethodCount:
enabled: false
Design/LongClass:
enabled: false
Design/LongMethod:
enabled: false
Design/NpathComplexity:
enabled: false
CyclomaticComplexity:
enabled: false
CleanCode/ElseExpression:
enabled: false
CleanCode/StaticAccess:
enabled: false
enabled: false
phan:
enabled: false
config:
file_extensions: "php"
phpcodesniffer:
enabled: true
config:
file_extensions: "php"
standard: "PSR2"
ignore_warnings: true
ratings:
paths:
- "**.php"
exclude_paths:
- tests/*
- vendor/*
exclude_patterns:
- "tests/"
- "vendor/"
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ LICENSE text eol=lf

# files/folders to ignore
/.* export-ignore
.bettercodehub.yml export-ignore text eol=lf
.codacy.yml export-ignore text eol=lf
.codeclimate.yml export-ignore text eol=lf
.coveralls.yml export-ignore text eol=lf
.editorconfig export-ignore text eol=lf
Expand All @@ -36,6 +38,7 @@ LICENSE text eol=lf
appveyor.yml export-ignore text eol=lf
.circleci/config.yml export-ignore text eol=lf
codecov.yml export-ignore text eol=lf
infection.json export-ignore text eol=lf
phpcs.xml export-ignore text eol=lf
phpstan.neon export-ignore text eol=lf
phpunit.xml export-ignore text eol=lf
Expand Down
4 changes: 2 additions & 2 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is part of the json-cache package.
*
* Copyright (c) 2018, Thomas Mueller <mimmi20@live.de>
* Copyright (c) 2018-2019, Thomas Mueller <mimmi20@live.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -13,7 +13,7 @@ declare(strict_types = 1);
$header = <<<'EOF'
This file is part of the json-cache package.

Copyright (c) 2018, Thomas Mueller <mimmi20@live.de>
Copyright (c) 2018-2019, Thomas Mueller <mimmi20@live.de>

For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
Expand Down
26 changes: 17 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ php:
- 7.2
- 7.3

os: linux
os:
- linux
#- windows

env:
- COMPOSER_FLAGS="--prefer-lowest"
Expand All @@ -17,10 +19,6 @@ cache:
directories:
- $HOME/.composer/cache

addons:
code_climate:
repo_token: 43db4d76514521ffd97e65f2a6806a106ae168f1db55397741485212f9c70ae7

stages:
- composer validate
- static code analysis
Expand All @@ -32,7 +30,9 @@ before_install:
- phpenv config-rm xdebug.ini || echo "xdebug not available"
- echo 'opcache.enable=1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo 'opcache.enable_cli=1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- travis_retry composer self-update
- echo 'zend.assertions=1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- echo 'assert.exception=On' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- composer self-update

install: travis_retry composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction --no-suggest $COMPOSER_FLAGS -vv

Expand All @@ -42,11 +42,13 @@ jobs:
allow_failures:
- php: 7.3
- php: nightly
#- os: windows
include:
- php: nightly
env: COMPOSER_FLAGS="--ignore-platform-reqs"

- stage: test with coverage
os: linux
php: 7.1
env:
- COVERAGE=yes
Expand All @@ -55,39 +57,45 @@ jobs:
- stty cols 130
- echo 'opcache.enable=1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo 'opcache.enable_cli=1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- travis_retry composer self-update
- echo 'zend.assertions=1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- echo 'assert.exception=On' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- composer self-update
script: vendor/bin/phpunit -c phpunit.xml --colors --columns 117 --coverage-clover=clover.xml --coverage-text
after_success:
- wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.0.0/php-coveralls.phar && php -n php-coveralls.phar --verbose --coverage_clover=clover.xml
- wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.1.0/php-coveralls.phar && php -n php-coveralls.phar --verbose --coverage_clover=clover.xml
- bash <(curl -s https://codecov.io/bash) -f clover.xml -F phpunit

- stage: composer validate
os: linux
php: 7.1
env: COMPOSER_FLAGS=""
script:
- composer validate
- composer normalize --dry-run

- stage: static code analysis
os: linux
php: 7.1
env:
- TEST=phpcs
- COMPOSER_FLAGS=""
script: vendor/bin/phpcs --colors

- stage: static code analysis
os: linux
php: 7.1
env:
- TEST=php-cs-fixer
- COMPOSER_FLAGS=""
script: vendor/bin/php-cs-fixer fix --dry-run -vv

- stage: static code analysis
os: linux
php: 7.1
env:
- TEST=phpstan
- COMPOSER_FLAGS=""
script: vendor/bin/phpstan analyse -l max -c phpstan.neon --autoload-file=vendor/autoload.php --memory-limit=768M --no-progress src tests
script: vendor/bin/phpstan analyse -c phpstan.neon --memory-limit=768M --no-progress

notifications:
email: false
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2018 Thomas Müller
Copyright (c) 2018-2019 Thomas Müller

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"require": {
"php": "^7.1",
"ext-json": "*",
"daverandom/exceptional-json": "^1.0.1"
"daverandom/exceptional-json": "^1.0.4"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.13",
Expand All @@ -32,8 +32,8 @@
"phpstan/phpstan-deprecation-rules": "^0.10",
"phpstan/phpstan-phpunit": "^0.10",
"phpstan/phpstan-strict-rules": "^0.10",
"phpunit/phpunit": "^7.4",
"squizlabs/php_codesniffer": "^3.3"
"phpunit/phpunit": "^7.5",
"squizlabs/php_codesniffer": "^3.4"
},
"autoload": {
"psr-4": {
Expand Down
5 changes: 5 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
parameters:
level: max
paths:
- src
- tests
autoload_files:
- %currentWorkingDirectory%/vendor/autoload.php
- %currentWorkingDirectory%/vendor/squizlabs/php_codesniffer/autoload.php
- %currentWorkingDirectory%/vendor/squizlabs/php_codesniffer/src/Util/Tokens.php
includes:
Expand Down
2 changes: 1 addition & 1 deletion src/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is part of the json-cache package.
*
* Copyright (c) 2018, Thomas Mueller <mimmi20@live.de>
* Copyright (c) 2018-2019, Thomas Mueller <mimmi20@live.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
2 changes: 1 addition & 1 deletion src/JsonInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is part of the json-cache package.
*
* Copyright (c) 2018, Thomas Mueller <mimmi20@live.de>
* Copyright (c) 2018-2019, Thomas Mueller <mimmi20@live.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
2 changes: 1 addition & 1 deletion tests/JsonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* This file is part of the json-cache package.
*
* Copyright (c) 2018, Thomas Mueller <mimmi20@live.de>
* Copyright (c) 2018-2019, Thomas Mueller <mimmi20@live.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down