Skip to content

Improves code style #34

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 2 commits into from
Jun 3, 2017
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
1 change: 1 addition & 0 deletions src/FqsenResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ private function isFqsen($type)
* @param Context $context
*
* @return Fqsen
* @throws \InvalidArgumentException when type is not a valid FQSEN.
*/
private function resolvePartialStructuralElementName($type, Context $context)
{
Expand Down
45 changes: 23 additions & 22 deletions src/TypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,28 @@ final class TypeResolver

/** @var string[] List of recognized keywords and unto which Value Object they map */
private $keywords = array(
'string' => 'phpDocumentor\Reflection\Types\String_',
'int' => 'phpDocumentor\Reflection\Types\Integer',
'integer' => 'phpDocumentor\Reflection\Types\Integer',
'bool' => 'phpDocumentor\Reflection\Types\Boolean',
'boolean' => 'phpDocumentor\Reflection\Types\Boolean',
'float' => 'phpDocumentor\Reflection\Types\Float_',
'double' => 'phpDocumentor\Reflection\Types\Float_',
'object' => 'phpDocumentor\Reflection\Types\Object_',
'mixed' => 'phpDocumentor\Reflection\Types\Mixed',
'array' => 'phpDocumentor\Reflection\Types\Array_',
'resource' => 'phpDocumentor\Reflection\Types\Resource',
'void' => 'phpDocumentor\Reflection\Types\Void_',
'null' => 'phpDocumentor\Reflection\Types\Null_',
'scalar' => 'phpDocumentor\Reflection\Types\Scalar',
'callback' => 'phpDocumentor\Reflection\Types\Callable_',
'callable' => 'phpDocumentor\Reflection\Types\Callable_',
'false' => 'phpDocumentor\Reflection\Types\Boolean',
'true' => 'phpDocumentor\Reflection\Types\Boolean',
'self' => 'phpDocumentor\Reflection\Types\Self_',
'$this' => 'phpDocumentor\Reflection\Types\This',
'static' => 'phpDocumentor\Reflection\Types\Static_',
'parent' => 'phpDocumentor\Reflection\Types\Parent_',
'string' => Types\String_::class,
'int' => Types\Integer::class,
'integer' => Types\Integer::class,
'bool' => Types\Boolean::class,
'boolean' => Types\Boolean::class,
'float' => Types\Float_::class,
'double' => Types\Float_::class,
'object' => Object_::class,
'mixed' => Types\Mixed::class,
'array' => Array_::class,
'resource' => Types\Resource::class,
'void' => Types\Void_::class,
'null' => Types\Null_::class,
'scalar' => Types\Scalar::class,
'callback' => Types\Callable_::class,
'callable' => Types\Callable_::class,
'false' => Types\Boolean::class,
'true' => Types\Boolean::class,
'self' => Types\Self_::class,
'$this' => Types\This::class,
'static' => Types\Static_::class,
'parent' => Types\Parent_::class,
'iterable' => Iterable_::class,
);

Expand Down Expand Up @@ -255,6 +255,7 @@ private function resolveKeyword($type)
* Resolves the given FQSEN string into an FQSEN object.
*
* @param string $type
* @param Context|null $context
*
* @return Object_
*/
Expand Down
1 change: 0 additions & 1 deletion src/Types/Array_.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

namespace phpDocumentor\Reflection\Types;

use phpDocumentor\Reflection\Fqsen;
use phpDocumentor\Reflection\Type;

/**
Expand Down
3 changes: 2 additions & 1 deletion src/Types/Compound.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@
final class Compound implements Type
{
/** @var Type[] */
private $types = [];
private $types;

/**
* Initializes a compound type (i.e. `string|int`) and tests if the provided types all implement the Type interface.
*
* @param Type[] $types
* @throws \InvalidArgumentException when types are not all instance of Type
*/
public function __construct(array $types)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Types/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
final class Context
{
/** @var string The current namespace. */
private $namespace = '';
private $namespace;

/** @var array List of namespace aliases => Fully Qualified Namespace. */
private $namespaceAliases = [];
private $namespaceAliases;

/**
* Initializes the new context and normalizes all passed namespaces to be in Qualified Namespace Name (QNN)
Expand Down
2 changes: 1 addition & 1 deletion src/Types/ContextFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ final class ContextFactory
/**
* Build a Context given a Class Reflection.
*
* @param \ReflectionClass $reflector
* @param \Reflector $reflector
*
* @see Context for more information on Contexts.
*
Expand Down
1 change: 1 addition & 0 deletions src/Types/Object_.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ final class Object_ implements Type
* Initializes this object with an optional FQSEN, if not provided this object is considered 'untyped'.
*
* @param Fqsen $fqsen
* @throws \InvalidArgumentException when provided $fqsen is not a valid type.
*/
public function __construct(Fqsen $fqsen = null)
{
Expand Down
Loading