Skip to content

Commit b2efb79

Browse files
committed
Update build
1 parent a2dc544 commit b2efb79

10 files changed

+35
-43
lines changed

.travis.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
language: php
2+
23
php:
34
- 7.2
45
- 7.3
@@ -9,15 +10,15 @@ before_install:
910
- phpenv config-rm xdebug.ini || return 0 # Turn off XDebug
1011

1112
install:
12-
- travis_retry composer install --no-progress --prefer-dist # Install dependencies
13+
- travis_retry composer install --no-progress --prefer-dist
1314

1415
script:
15-
- make tests # Tests
16+
- make tests
1617

1718
jobs:
1819
include:
19-
- env: title="Lowest Dependencies 7.3"
20-
php: 7.3
20+
- env: title="Lowest Dependencies"
21+
php: 7.2
2122
install:
2223
- travis_retry composer update --no-progress --prefer-dist --prefer-lowest --prefer-stable
2324
script:

Makefile

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
11
.PHONY: qa lint cs csf phpstan tests coverage
22

33
all:
4-
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs
4+
@awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m<target>\033[0m\n\nTargets:\n"}'
5+
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
56

6-
vendor: composer.json composer.lock
7-
composer install
7+
# QA
88

9-
qa: lint phpstan cs
9+
qa: lint phpstan cs ## Check code quality - coding style and static analysis
1010

11-
lint: vendor
11+
lint: ## Check PHP files syntax
1212
vendor/bin/linter src tests
1313

14-
cs: vendor
14+
cs: ## Check PHP files coding style
1515
vendor/bin/codesniffer src tests
1616

17-
csf: vendor
17+
csf: ## Fix PHP files coding style
1818
vendor/bin/codefixer src tests
1919

20-
phpstan: vendor
20+
phpstan: ## Analyse code with PHPStan
2121
vendor/bin/phpstan analyse -l max -c phpstan.neon src
2222

23-
tests: vendor
23+
# Tests
24+
25+
tests: ## Run all tests
2426
vendor/bin/phpunit tests --cache-result-file=tests/tmp/phpunit.cache --colors=always
2527

26-
coverage: vendor
27-
vendor/bin/phpdbg -qrr vendor/bin/phpunit tests --cache-result-file=tests/tmp/phpunit.cache --colors=always -c tests/coverage.xml
28+
coverage: ## Generate code coverage in XML format
29+
phpdbg -qrr vendor/bin/phpunit tests --cache-result-file=tests/tmp/phpunit.cache --colors=always -c tests/coverage.xml

composer.json

+2-5
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@
2222
"doctrine/cache": "^1.8.0"
2323
},
2424
"require-dev": {
25-
"mockery/mockery": "^1.2.2",
2625
"nettrine/cache": "^0.1.0",
27-
"ninjify/qa": "^0.9.0",
26+
"ninjify/qa": "^0.10.0",
2827
"phpstan/extension-installer": "^1.0",
2928
"phpstan/phpstan-deprecation-rules": "^0.11.0",
3029
"phpstan/phpstan-nette": "^0.11.0",
@@ -39,9 +38,7 @@
3938
},
4039
"autoload-dev": {
4140
"psr-4": {
42-
"Tests\\Cases\\": "tests/cases",
43-
"Tests\\Fixtures\\": "tests/fixtures",
44-
"Tests\\Toolkit\\": "tests/toolkit"
41+
"Tests\\Nettrine\\Annotations\\": "tests"
4542
}
4643
},
4744
"minimum-stability": "dev",

ruleset.xml

+2-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
77
<properties>
88
<property name="rootNamespaces" type="array" value="
9-
src=>Nettrine\Annotations,
10-
tests/cases=>Tests\Cases,
11-
tests/fixtures=>Tests\Fixtures,
12-
tests/toolkit=>Tests\Toolkit
9+
src => Nettrine\Annotations,
10+
tests => Tests\Nettrine\Annotations,
1311
"/>
1412
</properties>
1513
</rule>

tests/fixtures/SampleAnnotation.php tests/Fixtures/SampleAnnotation.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php declare(strict_types = 1);
22

3-
namespace Tests\Fixtures;
3+
namespace Tests\Nettrine\Annotations\Fixtures;
44

55
use Doctrine\Common\Annotations\Annotation;
66

tests/fixtures/SampleClass.php tests/Fixtures/SampleClass.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php declare(strict_types = 1);
22

3-
namespace Tests\Fixtures;
3+
namespace Tests\Nettrine\Annotations\Fixtures;
44

55
/**
66
* @ignoredAnnotation

tests/toolkit/NeonLoader.php tests/Toolkit/NeonLoader.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php declare(strict_types = 1);
22

3-
namespace Tests\Toolkit;
3+
namespace Tests\Nettrine\Annotations\Toolkit;
44

55
use Nette\DI\Config\Adapters\NeonAdapter;
66
use Nette\Neon\Neon;
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<?php declare(strict_types = 1);
22

3-
namespace Tests\Toolkit;
3+
namespace Tests\Nettrine\Annotations\Toolkit;
44

5-
use Mockery;
65
use PHPUnit\Framework\TestCase as PHPUnitTestCase;
76

87
abstract class TestCase extends PHPUnitTestCase
@@ -17,13 +16,8 @@ protected function setUp(): void
1716
}
1817

1918
if (!defined('FIXTURES_PATH')) {
20-
define('FIXTURES_PATH', __DIR__ . '/../fixtures');
19+
define('FIXTURES_PATH', __DIR__ . '/../Fixtures');
2120
}
2221
}
2322

24-
protected function tearDown(): void
25-
{
26-
Mockery::close();
27-
}
28-
2923
}

tests/cases/Unit/DI/AnnotationsExtensionTest.php tests/Unit/DI/AnnotationsExtensionTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php declare(strict_types = 1);
22

3-
namespace Tests\Cases\Unit\DI;
3+
namespace Tests\Nettrine\Annotations\Unit\DI;
44

55
use Doctrine\Common\Annotations\CachedReader;
66
use Doctrine\Common\Annotations\Reader;
@@ -13,8 +13,8 @@
1313
use Nette\InvalidStateException;
1414
use Nettrine\Annotations\DI\AnnotationsExtension;
1515
use Nettrine\Cache\DI\CacheExtension;
16-
use Tests\Toolkit\NeonLoader;
17-
use Tests\Toolkit\TestCase;
16+
use Tests\Nettrine\Annotations\Toolkit\NeonLoader;
17+
use Tests\Nettrine\Annotations\Toolkit\TestCase;
1818

1919
final class AnnotationsExtensionTest extends TestCase
2020
{

tests/cases/Unit/Reader/ReaderTest.php tests/Unit/Reader/ReaderTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?php declare(strict_types = 1);
22

3-
namespace Tests\Cases\Unit\Reader;
3+
namespace Tests\Nettrine\Annotations\Unit\Reader;
44

55
use Doctrine\Common\Annotations\Reader;
66
use Nette\DI\Compiler;
77
use Nette\DI\Container;
88
use Nette\DI\ContainerLoader;
99
use Nettrine\Annotations\DI\AnnotationsExtension;
1010
use ReflectionClass;
11-
use Tests\Fixtures\SampleAnnotation;
12-
use Tests\Fixtures\SampleClass;
13-
use Tests\Toolkit\NeonLoader;
14-
use Tests\Toolkit\TestCase;
11+
use Tests\Nettrine\Annotations\Fixtures\SampleAnnotation;
12+
use Tests\Nettrine\Annotations\Fixtures\SampleClass;
13+
use Tests\Nettrine\Annotations\Toolkit\NeonLoader;
14+
use Tests\Nettrine\Annotations\Toolkit\TestCase;
1515

1616
final class ReaderTest extends TestCase
1717
{

0 commit comments

Comments
 (0)