Skip to content

Commit 8b2c0fb

Browse files
mabarMilan Felix Šulc
authored and
Milan Felix Šulc
committed
Update build
1 parent aff89a8 commit 8b2c0fb

10 files changed

+68
-59
lines changed

Diff for: .editorconfig

+5-9
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
# EditorConfig is awesome: http://EditorConfig.org
22

3-
# Top-most EditorConfig file
43
root = true
54

6-
# Unix-style newlines with a newline ending every file
75
[*]
6+
charset = utf-8
87
end_of_line = lf
98
insert_final_newline = true
10-
11-
# JS / PHP
12-
[*.{js,php,phpt}]
13-
charset = utf-8
9+
trim_trailing_whitespace = true
1410
indent_style = tab
15-
indent_size = 4
11+
indent_size = tab
12+
tab_width = 4
1613

17-
# Composer
18-
[{composer.json}]
14+
[{*.json,*.yml,*.md}]
1915
indent_style = space
2016
indent_size = 2

Diff for: .gitattributes

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
/.docs export-ignore
2-
/tests export-ignore
3-
/.editorconfig export-ignore
4-
/.gitattributes export-ignore
5-
/.gitignore export-ignore
6-
/.travis.yml export-ignore
7-
/LICENSE export-ignore
8-
/phpstan.neon export-ignore
9-
/README.md export-ignore
1+
# Not archived
2+
.docs export-ignore
3+
tests export-ignore
4+
.editorconfig export-ignore
5+
.gitattributes export-ignore
6+
.gitignore export-ignore
7+
.travis.yml export-ignore
8+
phpstan.neon export-ignore
9+
README.md export-ignore
10+
ruleset.xml export-ignore

Diff for: .gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
/vendor
66
/composer.lock
77

8-
# Temp
9-
/temp
8+
# Tests
9+
/coverage.xml

Diff for: .travis.yml

+25-15
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
language: php
22
php:
3-
- 7.1
4-
- 7.2
3+
- 7.1
4+
- 7.2
5+
- 7.3
6+
7+
before_install:
8+
# Turn off XDebug
9+
- phpenv config-rm xdebug.ini || return 0
510

611
install:
712
# Composer
813
- travis_retry composer install --no-progress --prefer-dist
914

1015
script:
11-
# Tester
12-
- composer run-script tester
16+
# Tests
17+
- composer run-script tests
18+
19+
after_failure:
20+
# Print *.actual content
21+
- for i in $(find tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done
1322

1423
jobs:
1524
include:
@@ -18,34 +27,35 @@ jobs:
1827
install:
1928
- travis_retry composer update --no-progress --prefer-dist --prefer-lowest
2029
script:
21-
- composer run-script tester
30+
- composer run-script tests
2231

2332
- stage: Quality Assurance
2433
php: 7.1
2534
script:
2635
- composer run-script qa
2736

37+
- stage: Phpstan
38+
php: 7.1
39+
script:
40+
- composer run-script phpstan
41+
2842
- stage: Test Coverage
43+
if: branch = master AND type = push
2944
php: 7.1
3045
script:
3146
- composer run-script coverage
3247
after_script:
33-
- wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar
34-
- php coveralls.phar --verbose --config tests/.coveralls.yml
48+
- composer global require php-coveralls/php-coveralls ^2.1.0
49+
- ~/.composer/vendor/bin/php-coveralls --verbose --config tests/.coveralls.yml
3550

36-
- stage: Phpstan
51+
- stage: Outdated Dependencies
52+
if: branch = master AND type = cron
3753
php: 7.1
3854
script:
39-
- composer run-script phpstan-install
40-
- composer run-script phpstan
55+
- composer outdated --direct --strict
4156

4257
allow_failures:
4358
- stage: Test Coverage
44-
- stage: Phpstan
45-
46-
after_failure:
47-
# Print *.actual content
48-
- for i in $(find tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done
4959

5060
sudo: false
5161

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
[![Build Status](https://img.shields.io/travis/nettrine/annotations.svg?style=flat-square)](https://travis-ci.org/nettrine/annotations)
88
[![Code coverage](https://img.shields.io/coveralls/nettrine/annotations.svg?style=flat-square)](https://coveralls.io/r/nettrine/annotations)
99
[![Licence](https://img.shields.io/packagist/l/nettrine/annotations.svg?style=flat-square)](https://packagist.org/packages/nettrine/annotations)
10-
1110
[![Downloads this Month](https://img.shields.io/packagist/dm/nettrine/annotations.svg?style=flat-square)](https://packagist.org/packages/nettrine/annotations)
1211
[![Downloads total](https://img.shields.io/packagist/dt/nettrine/annotations.svg?style=flat-square)](https://packagist.org/packages/nettrine/annotations)
1312
[![Latest stable](https://img.shields.io/packagist/v/nettrine/annotations.svg?style=flat-square)](https://packagist.org/packages/nettrine/annotations)
13+
[![PHPStan](https://img.shields.io/badge/PHPStan-enabled-brightgreen.svg?style=flat-square)](https://github.com/phpstan/phpstan)
1414

1515
## Discussion / Help
1616

@@ -55,7 +55,7 @@ composer require nettrine/annotations
5555
<a href="https://github.com/benijo">Josef Benjač</a>
5656
</td>
5757
</tr>
58-
<tbody>
58+
</tbody>
5959
</table>
6060

6161
-----

Diff for: composer.json

+11-12
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Doctrine Annotations for Nette Framework",
44
"keywords": ["nettrine", "nette", "doctrine", "annotations"],
55
"type": "library",
6-
"license": ["MIT"],
6+
"license": "MIT",
77
"homepage": "https://github.com/nettrine/annotations",
88
"authors": [
99
{
@@ -14,12 +14,16 @@
1414
"require": {
1515
"php": ">=7.1",
1616
"doctrine/annotations": "^1.6.0",
17-
"nette/di": "^2.4.14",
18-
"doctrine/cache": "^1.8.0"
17+
"doctrine/cache": "^1.8.0",
18+
"nette/di": "^2.4.14"
1919
},
2020
"require-dev": {
2121
"ninjify/qa": "^0.8.0",
22-
"ninjify/nunjuck": "^0.2.0"
22+
"ninjify/nunjuck": "^0.2.0",
23+
"phpstan/phpstan-shim": "^0.10.6",
24+
"phpstan/phpstan-deprecation-rules": "^0.10.2",
25+
"phpstan/phpstan-nette": "^0.10.1",
26+
"phpstan/phpstan-strict-rules": "^0.10.1"
2327
},
2428
"autoload": {
2529
"psr-4": {
@@ -39,19 +43,14 @@
3943
"linter src tests",
4044
"codesniffer src tests"
4145
],
42-
"tester": [
46+
"tests": [
4347
"tester -s -p php --colors 1 -C tests/cases"
4448
],
4549
"coverage": [
46-
"tester -s -p php --colors 1 -C -d extension=xdebug.so --coverage ./coverage.xml --coverage-src ./src tests/cases"
47-
],
48-
"phpstan-install": [
49-
"mkdir -p temp/phpstan",
50-
"composer require -d temp/phpstan phpstan/phpstan:0.9",
51-
"composer require -d temp/phpstan phpstan/phpstan-nette:0.9"
50+
"tester -s -p phpdbg --colors 1 -C --coverage ./coverage.xml --coverage-src ./src tests/cases"
5251
],
5352
"phpstan": [
54-
"temp/phpstan/vendor/bin/phpstan analyse -l max -c phpstan.neon src"
53+
"vendor/bin/phpstan analyse -l max -c phpstan.neon src"
5554
]
5655
},
5756
"extra": {

Diff for: phpstan.neon

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
includes:
2-
- temp/phpstan/vendor/phpstan/phpstan-nette/extension.neon
3-
- temp/phpstan/vendor/phpstan/phpstan-nette/rules.neon
2+
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
3+
- vendor/phpstan/phpstan-nette/extension.neon
4+
- vendor/phpstan/phpstan-nette/rules.neon
5+
- vendor/phpstan/phpstan-strict-rules/rules.neon
46

57
parameters:
68
ignoreErrors:
7-
- '#Parameter \#1 \$reader of method Doctrine\\Common\\Persistence\\Mapping\\Driver\\AnnotationDriver::__construct\(\) expects Doctrine\\Common\\Annotations\\AnnotationReader, Doctrine\\Common\\Annotations\\Reader given.#'
8-
- '#Property Doctrine\\Common\\Persistence\\Mapping\\Driver\\AnnotationDriver::\$reader \(Doctrine\\Common\\Annotations\\AnnotationReader\) does not accept Doctrine\\Common\\Annotations\\Reader.#'
9+
# No replacement available
10+
- '#Call to deprecated method registerUniqueLoader\(\) of class Doctrine\\Common\\Annotations\\AnnotationRegistry.#'

Diff for: src/DI/AnnotationsExtension.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Doctrine\Common\Cache\ArrayCache;
1010
use Doctrine\Common\Cache\FilesystemCache;
1111
use Nette\DI\CompilerExtension;
12+
use Nette\DI\Helpers;
1213
use Nette\DI\Statement;
1314
use Nette\PhpGenerator\ClassType;
1415
use Nette\PhpGenerator\PhpLiteral;
@@ -32,7 +33,7 @@ public function loadConfiguration(): void
3233
$config = $this->getConfig($this->defaults);
3334

3435
$reader = $builder->addDefinition($this->prefix('delegatedReader'))
35-
->setClass(AnnotationReader::class)
36+
->setFactory(AnnotationReader::class)
3637
->setAutowired(false);
3738

3839
foreach ((array) $config['ignore'] as $annotationName) {
@@ -43,7 +44,7 @@ public function loadConfiguration(): void
4344
$this->loadCacheConfiguration();
4445

4546
$builder->addDefinition($this->prefix('reader'))
46-
->setClass(Reader::class)
47+
->setType(Reader::class)
4748
->setFactory(CachedReader::class, [
4849
$this->prefix('@delegatedReader'),
4950
$this->prefix('@cache'),
@@ -61,7 +62,7 @@ protected function loadCacheConfiguration(): void
6162
if (is_string($config['cache'])) {
6263
// FilesystemCache needs extra configuration (paths)
6364
if ($config['cache'] === FilesystemCache::class) {
64-
$path = $builder->expand('%tempDir%/cache/Doctrine.Annotations');
65+
$path = Helpers::expand('%tempDir%/cache/Doctrine.Annotations', $builder->parameters);
6566
$builder->addDefinition($this->prefix('cache'))
6667
->setFactory($config['cache'], [$path])
6768
->setAutowired(false);
@@ -75,7 +76,7 @@ protected function loadCacheConfiguration(): void
7576
$builder->addDefinition($this->prefix('cache'))
7677
->setFactory($config['cache'])
7778
->setAutowired(false);
78-
} elseif (!$config['cache']) {
79+
} elseif ($config['cache'] === null || $config['cache'] === false) {
7980
// No cache (memory only)
8081
$builder->addDefinition($this->prefix('cache'))
8182
->setFactory(ArrayCache::class)

Diff for: tests/.coveralls.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# for php-coveralls
22
service_name: travis-ci
33
coverage_clover: coverage.xml
4-
json_path: coverage.json
4+
json_path: coverage.json

Diff for: tests/.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77

88
# Files
99
/*.log
10-
/*.html
10+
/*.html

0 commit comments

Comments
 (0)