Skip to content

finish strict typing; bump reflection-common dep #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
"email": "me@mikevanriel.com"
}
],
"minimum-stability": "alpha",
"require": {
"php": ">=7.1",
"phpdocumentor/reflection-common": "^1.0"
"phpdocumentor/reflection-common": "^2.0"
},
"require-dev": {
"mockery/mockery": "^1.0",
Expand All @@ -25,10 +26,5 @@
"psr-4": {
"phpDocumentor\\Reflection\\": "tests"
}
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
}
}
18 changes: 9 additions & 9 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 4 additions & 10 deletions src/Types/AbstractList.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
/**
* This file is part of phpDocumentor.
*
Expand Down Expand Up @@ -44,10 +44,8 @@ public function __construct(Type $valueType = null, Type $keyType = null)

/**
* Returns the type for the keys of this array.
*
* @return Type
*/
public function getKeyType()
public function getKeyType(): Type
{
if ($this->keyType === null) {
return $this->defaultKeyType;
Expand All @@ -58,20 +56,16 @@ public function getKeyType()

/**
* Returns the value for the keys of this array.
*
* @return Type
*/
public function getValueType()
public function getValueType(): Type
{
return $this->valueType;
}

/**
* Returns a rendered output of the Type as it would be used in a DocBlock.
*
* @return string
*/
public function __toString()
public function __toString(): string
{
if ($this->keyType) {
return 'array<' . $this->keyType . ',' . $this->valueType . '>';
Expand Down
6 changes: 2 additions & 4 deletions src/Types/Collection.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
/**
* This file is part of phpDocumentor.
*
Expand Down Expand Up @@ -55,10 +55,8 @@ public function getFqsen()

/**
* Returns a rendered output of the Type as it would be used in a DocBlock.
*
* @return string
*/
public function __toString()
public function __toString(): string
{
if ($this->keyType === null) {
return $this->fqsen . '<' . $this->valueType . '>';
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/CollectionResolverTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
/**
* This file is part of phpDocumentor.
*
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Types/CompoundTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
/**
* This file is part of phpDocumentor.
*
Expand Down