Skip to content

Commit 867d314

Browse files
authored
Updates the CI, unit test
- fixes unit tests (for phpunit 7+) - min PHP version is 7.2 - CI updates (added Scrutinizer) - removes a double key verification - cleanup
1 parent 203bd4c commit 867d314

8 files changed

Lines changed: 32 additions & 12 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
build
22
vendor
33
.idea
4-
composer.lock
4+
composer.lock
5+
*.cache

.scrutinizer.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
build:
2+
nodes:
3+
analysis:
4+
tests:
5+
stop_on_failure: true
6+
override:
7+
- php-scrutinizer-run
8+
environment:
9+
php:
10+
version: '7.2'
11+
dependencies:
12+
override:
13+
- composer install --no-interaction --prefer-source
14+
15+
filter:
16+
excluded_paths:
17+
- 'Tests/'
18+
- 'vendor/'
19+
20+
tools:
21+
php_analyzer: true
22+
external_code_coverage: true

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ script:
3636
- vendor/bin/phpunit --coverage-clover build/coverage/clover.xml
3737

3838
after_success:
39-
- travis_retry vendor/bin/codacycoverage clover build/coverage/clover.xml
39+
- travis_retry vendor/bin/ocular code-coverage:upload --format=php-clover build/coverage/clover.xml

CacheItem.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ abstract class CacheItem implements CacheItemInterface
1010
/** @var bool */
1111
protected $isHit = false;
1212

13-
/** @var string */
13+
/** @var string Expects a valid cache key name */
1414
private $key;
1515

1616
/** @var mixed */
@@ -22,7 +22,6 @@ abstract class CacheItem implements CacheItemInterface
2222

2323
public function __construct($key, ?int $ttl)
2424
{
25-
verify_key($key);
2625
$this->key = $key;
2726
$this->expiresAt = $ttl;
2827
}

CacheItemPool.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public function __destruct()
2323
{
2424
$this->commit();
2525
}
26-
2726
// @codeCoverageIgnoreEnd
2827

2928
public function commit(): bool
@@ -70,7 +69,6 @@ public function getItem($key): CacheItemInterface
7069

7170
(function() {
7271
$this->isHit = true;
73-
7472
return $this;
7573
})->call($item);
7674

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ Koded - Extended Caching Library
33

44
[![Latest Stable Version](https://img.shields.io/packagist/v/koded/cache-extended.svg)](https://packagist.org/packages/koded/cache-extended)
55
[![Build Status](https://travis-ci.org/kodedphp/cache-extended.svg?branch=master)](https://travis-ci.org/kodedphp/cache-extended)
6-
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/f1aefebb27b1485dbeb2b00ffe7c77fc)](https://www.codacy.com/app/kodeart/cache-extended)
7-
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/f1aefebb27b1485dbeb2b00ffe7c77fc)](https://www.codacy.com/app/kodeart/cache-extended)
6+
[![Code Coverage](https://scrutinizer-ci.com/g/kodedphp/cache-extended/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/kodedphp/cache-extended/?branch=master)
7+
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/kodedphp/cache-extended/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/kodedphp/cache-extended/?branch=master)
88
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.2-8892BF.svg)](https://php.net/)
99
[![Software license](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](LICENSE)
1010

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.0
1+
1.2.1

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"authors": [
1717
{
1818
"name": "Mihail Binev",
19-
"homepage": "http://kodeart.com"
19+
"homepage": "https://kodeart.com"
2020
}
2121
],
2222
"prefer-stable": true,
@@ -42,10 +42,10 @@
4242
},
4343
"require-dev": {
4444
"phpunit/phpunit": "~7",
45-
"mikey179/vfsStream": "~1",
45+
"mikey179/vfsstream": "~1",
4646
"predis/predis": "dev-master",
4747
"cache/integration-tests": "dev-master",
48-
"codacy/coverage": "dev-master",
48+
"scrutinizer/ocular": "^1.6",
4949
"symfony/phpunit-bridge": "^4.4@dev"
5050
},
5151
"extra": {

0 commit comments

Comments
 (0)