Skip to content

Commit 6b6613f

Browse files
authored
Merge pull request #54 from ashnazg/strict
finish strict typing; bump reflection-common dep
2 parents 54760a1 + fdf3df6 commit 6b6613f

File tree

6 files changed

+19
-31
lines changed

6 files changed

+19
-31
lines changed

composer.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
"email": "[email protected]"
99
}
1010
],
11+
"minimum-stability": "alpha",
1112
"require": {
1213
"php": ">=7.1",
13-
"phpdocumentor/reflection-common": "^1.0"
14+
"phpdocumentor/reflection-common": "^2.0"
1415
},
1516
"require-dev": {
1617
"mockery/mockery": "^1.0",
@@ -25,10 +26,5 @@
2526
"psr-4": {
2627
"phpDocumentor\\Reflection\\": "tests"
2728
}
28-
},
29-
"extra": {
30-
"branch-alias": {
31-
"dev-master": "1.0.x-dev"
32-
}
3329
}
3430
}

composer.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Types/AbstractList.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php declare(strict_types=1);
22
/**
33
* This file is part of phpDocumentor.
44
*
@@ -44,10 +44,8 @@ public function __construct(Type $valueType = null, Type $keyType = null)
4444

4545
/**
4646
* Returns the type for the keys of this array.
47-
*
48-
* @return Type
4947
*/
50-
public function getKeyType()
48+
public function getKeyType(): Type
5149
{
5250
if ($this->keyType === null) {
5351
return $this->defaultKeyType;
@@ -58,20 +56,16 @@ public function getKeyType()
5856

5957
/**
6058
* Returns the value for the keys of this array.
61-
*
62-
* @return Type
6359
*/
64-
public function getValueType()
60+
public function getValueType(): Type
6561
{
6662
return $this->valueType;
6763
}
6864

6965
/**
7066
* Returns a rendered output of the Type as it would be used in a DocBlock.
71-
*
72-
* @return string
7367
*/
74-
public function __toString()
68+
public function __toString(): string
7569
{
7670
if ($this->keyType) {
7771
return 'array<' . $this->keyType . ',' . $this->valueType . '>';

src/Types/Collection.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php declare(strict_types=1);
22
/**
33
* This file is part of phpDocumentor.
44
*
@@ -55,10 +55,8 @@ public function getFqsen()
5555

5656
/**
5757
* Returns a rendered output of the Type as it would be used in a DocBlock.
58-
*
59-
* @return string
6058
*/
61-
public function __toString()
59+
public function __toString(): string
6260
{
6361
if ($this->keyType === null) {
6462
return $this->fqsen . '<' . $this->valueType . '>';

tests/unit/CollectionResolverTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php declare(strict_types=1);
22
/**
33
* This file is part of phpDocumentor.
44
*

tests/unit/Types/CompoundTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php declare(strict_types=1);
22
/**
33
* This file is part of phpDocumentor.
44
*

0 commit comments

Comments
 (0)