Skip to content

Commit b1cfce2

Browse files
authored
Merge pull request #27 from jakzal/2.0
Drop support for types defined in docblocks
2 parents 4160c0e + 938c86b commit b1cfce2

File tree

15 files changed

+28
-66
lines changed

15 files changed

+28
-66
lines changed

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
language: php
22
matrix:
33
include:
4-
- php: 7.2
5-
env: EXECUTE_DEPLOYMENT=true
6-
- php: 7.3
4+
- php: 7.4
75
env: deps=low
86
- php: 7.4
7+
env: EXECUTE_DEPLOYMENT=true
98
fast_finish: true
109
before_install:
1110
- phpenv config-rm xdebug.ini || echo "XDebug not enabled"

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ package: tools/box
7171

7272
cd build/phar && \
7373
composer remove phpunit/phpunit --no-update && \
74-
composer config platform.php 7.2 && \
74+
composer config platform.php 7.4 && \
7575
composer update --no-dev -o -a
7676

7777
tools/box compile
@@ -93,16 +93,16 @@ tools/deptrac:
9393
curl -Ls http://get.sensiolabs.de/deptrac.phar -o tools/deptrac && chmod +x tools/deptrac
9494

9595
tools/infection: tools/infection.pubkey
96-
curl -Ls https://github.com/infection/infection/releases/download/0.15.0/infection.phar -o tools/infection && chmod +x tools/infection
96+
curl -Ls https://github.com/infection/infection/releases/download/0.15.1/infection.phar -o tools/infection && chmod +x tools/infection
9797

9898
tools/infection.pubkey:
99-
curl -Ls https://github.com/infection/infection/releases/download/0.15.0/infection.phar.pubkey -o tools/infection.pubkey
99+
curl -Ls https://github.com/infection/infection/releases/download/0.15.1/infection.phar.pubkey -o tools/infection.pubkey
100100

101101
tools/box:
102102
curl -Ls https://github.com/humbug/box/releases/download/3.8.4/box.phar -o tools/box && chmod +x tools/box
103103

104104
tests/phar/tools/phpunit:
105-
curl -Ls https://phar.phpunit.de/phpunit-8.phar -o tests/phar/tools/phpunit && chmod +x tests/phar/tools/phpunit
105+
curl -Ls https://phar.phpunit.de/phpunit-9.phar -o tests/phar/tools/phpunit && chmod +x tests/phar/tools/phpunit
106106

107107
tests/phar/tools/phpunit.d/zalas-phpunit-injector-extension.phar: build/zalas-phpunit-injector-extension.phar
108108
cp build/zalas-phpunit-injector-extension.phar tests/phar/tools/phpunit.d/zalas-phpunit-injector-extension.phar

README.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,10 @@ class ServiceInjectorTest extends TestCase implements ServiceContainerTestCase
7373
*/
7474
private LoggerInterface $logger;
7575

76-
/**
77-
* @var LoggerInterface
78-
* @inject
79-
*/
80-
private $anotherLogger;
81-
82-
8376
public function testThatServicesAreInjected()
8477
{
8578
$this->assertInstanceOf(SerializerInterface::class, $this->serializer, 'The service is injectd by its type');
8679
$this->assertInstanceOf(LoggerInterface::class, $this->logger, 'The service is injected by its id');
87-
$this->assertInstanceOf(LoggerInterface::class, $this->anotherLogger, 'The service is injected by its @var type');
8880
}
8981

9082
public function createServiceContainer(): ContainerInterface
@@ -95,7 +87,6 @@ class ServiceInjectorTest extends TestCase implements ServiceContainerTestCase
9587
```
9688

9789
The service is found by its type, or an id if it's given in the `@inject` tag.
98-
In legacy PHP versions the `@var` annotation can be used.
9990

10091
The `createServiceContainer` method would be usually provided by a base test case or a trait.
10192
In case of Symfony, such a trait is provided by this package (see the next section).

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
"description": "Injects services from a PSR-11 dependency injection container to PHPUnit test cases",
44
"type": "library",
55
"require": {
6-
"php": "^7.2,<8.0",
7-
"phpunit/phpunit": "^8.0",
6+
"php": "^7.4,<8.0",
7+
"phpunit/phpunit": "^9.0",
88
"psr/container": "^1.0",
9-
"zalas/injector": "^1.3"
9+
"zalas/injector": "^2.0"
1010
},
1111
"require-dev": {
1212
"symfony/config": "^3.4 || ^4.4 || ^5.0",
1313
"symfony/dependency-injection": "^3.4 || ^4.4 || ^5.0",
1414
"symfony/http-kernel": "^3.4 || ^4.4 || ^5.0",
1515
"zalas/phpunit-globals": "^2.0",
1616
"symfony/framework-bundle": "^3.4 || ^4.4 || ^5.0",
17-
"zalas/phpunit-doubles": "^1.2",
17+
"zalas/phpunit-doubles": "^1.4",
1818
"phpspec/prophecy": "^1.9"
1919
},
2020
"autoload": {
@@ -36,7 +36,7 @@
3636
],
3737
"extra": {
3838
"branch-alias": {
39-
"dev-master": "1.x-dev"
39+
"dev-master": "2.x-dev"
4040
}
4141
}
4242
}

manifest.xml.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<phar xmlns="https://phar.io/xml/manifest/1.0">
33
<contains name="zalas/phpunit-injector" version="@@version@@" type="extension">
4-
<extension for="phpunit/phpunit" compatible="^8.0"/>
4+
<extension for="phpunit/phpunit" compatible="^9.0"/>
55
</contains>
66

77
<copyright>
@@ -10,6 +10,6 @@
1010
</copyright>
1111

1212
<requires>
13-
<php version="^7.2"/>
13+
<php version="^7.4"/>
1414
</requires>
1515
</phar>

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.0/phpunit.xsd"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.0/phpunit.xsd"
44
bootstrap="vendor/autoload.php"
55
beStrictAboutOutputDuringTests="true"
66
beStrictAboutTodoAnnotatedTests="true"

src/Symfony/Compiler/Discovery/ClassFinder.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55

66
class ClassFinder
77
{
8-
/**
9-
* @var string
10-
*/
11-
private $path;
8+
private string $path;
129

1310
public function __construct(string $path = 'tests')
1411
{

src/Symfony/Compiler/Discovery/PropertyDiscovery.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,9 @@
1212

1313
class PropertyDiscovery
1414
{
15-
/**
16-
* @var ClassFinder
17-
*/
18-
private $classFinder;
15+
private ClassFinder $classFinder;
1916

20-
/**
21-
* @var ExtractorFactory
22-
*/
23-
private $extractorFactory;
17+
private ExtractorFactory $extractorFactory;
2418

2519
public function __construct(?ClassFinder $classFinder = null, ?ExtractorFactory $extractorFactory = null)
2620
{

src/Symfony/Compiler/ExposeServicesForTestsPass.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@
1717
*/
1818
class ExposeServicesForTestsPass implements CompilerPassInterface
1919
{
20-
/**
21-
* @var PropertyDiscovery
22-
*/
23-
private $propertyDiscovery;
20+
private PropertyDiscovery $propertyDiscovery;
2421

2522
public function __construct(?PropertyDiscovery $propertyDiscovery = null)
2623
{

src/Symfony/TestCase/SymfonyKernel.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@
1212
*/
1313
trait SymfonyKernel
1414
{
15-
/**
16-
* @var KernelInterface|null
17-
*/
18-
protected static $kernel;
15+
protected static ?KernelInterface $kernel = null;
1916

2017
protected static function bootKernel(array $options = []): KernelInterface
2118
{

0 commit comments

Comments
 (0)