From 52723f0fb83d053be05c3f6b58ec45e5851c0e99 Mon Sep 17 00:00:00 2001 From: Mike van Riel Date: Fri, 26 Feb 2016 21:44:16 +0100 Subject: [PATCH] Add aliases for Context class because newer phpunit versions have a global Context class --- src/DocBlock.php | 9 ++++----- src/DocBlock/DescriptionFactory.php | 10 +++++----- src/DocBlock/StandardTagFactory.php | 28 ++++++++++++++-------------- src/DocBlock/TagFactory.php | 6 +++--- src/DocBlock/Tags/Covers.php | 4 ++-- src/DocBlock/Tags/Deprecated.php | 4 ++-- src/DocBlock/Tags/Generic.php | 6 +++--- src/DocBlock/Tags/Link.php | 4 ++-- src/DocBlock/Tags/Method.php | 4 ++-- src/DocBlock/Tags/Param.php | 7 +++---- src/DocBlock/Tags/Property.php | 4 ++-- src/DocBlock/Tags/PropertyRead.php | 4 ++-- src/DocBlock/Tags/PropertyWrite.php | 4 ++-- src/DocBlock/Tags/Return_.php | 4 ++-- src/DocBlock/Tags/See.php | 4 ++-- src/DocBlock/Tags/Since.php | 4 ++-- src/DocBlock/Tags/Source.php | 4 ++-- src/DocBlock/Tags/Throws.php | 4 ++-- src/DocBlock/Tags/Uses.php | 4 ++-- src/DocBlock/Tags/Var_.php | 4 ++-- src/DocBlock/Tags/Version.php | 4 ++-- src/DocBlockFactory.php | 7 +++---- 22 files changed, 65 insertions(+), 68 deletions(-) diff --git a/src/DocBlock.php b/src/DocBlock.php index 23541ed..3991140 100644 --- a/src/DocBlock.php +++ b/src/DocBlock.php @@ -13,7 +13,6 @@ namespace phpDocumentor\Reflection; use phpDocumentor\Reflection\DocBlock\Tag; -use phpDocumentor\Reflection\Types\Context; use Webmozart\Assert\Assert; final class DocBlock @@ -27,7 +26,7 @@ final class DocBlock /** @var Tag[] An array containing all the tags in this docblock; except inline. */ private $tags = array(); - /** @var Context Information about the context of this DocBlock. */ + /** @var Types\Context Information about the context of this DocBlock. */ private $context = null; /** @var Location Information about the location of this DocBlock. */ @@ -43,7 +42,7 @@ final class DocBlock * @param string $summary * @param DocBlock\Description $description * @param DocBlock\Tag[] $tags - * @param Context $context The context in which the DocBlock occurs. + * @param Types\Context $context The context in which the DocBlock occurs. * @param Location $location The location within the file that this DocBlock occurs in. * @param bool $isTemplateStart * @param bool $isTemplateEnd @@ -52,7 +51,7 @@ final class DocBlock $summary = '', DocBlock\Description $description = null, array $tags = [], - Context $context = null, + Types\Context $context = null, Location $location = null, $isTemplateStart = false, $isTemplateEnd = false @@ -95,7 +94,7 @@ final class DocBlock /** * Returns the current context. * - * @return Context + * @return Types\Context */ public function getContext() { diff --git a/src/DocBlock/DescriptionFactory.php b/src/DocBlock/DescriptionFactory.php index c57f3bd..d59858b 100644 --- a/src/DocBlock/DescriptionFactory.php +++ b/src/DocBlock/DescriptionFactory.php @@ -12,7 +12,7 @@ namespace phpDocumentor\Reflection\DocBlock; -use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\Context as TypeContext; /** * Creates a new Description object given a body of text. @@ -50,11 +50,11 @@ class DescriptionFactory * Returns the parsed text of this description. * * @param string $contents - * @param Context $context + * @param TypeContext $context * * @return Description */ - public function create($contents, Context $context = null) + public function create($contents, TypeContext $context = null) { list($text, $tags) = $this->parse($this->lex($contents), $context); @@ -112,11 +112,11 @@ class DescriptionFactory * Parses the stream of tokens in to a new set of tokens containing Tags. * * @param string[] $tokens - * @param Context $context + * @param TypeContext $context * * @return string[]|Tag[] */ - private function parse($tokens, Context $context) + private function parse($tokens, TypeContext $context) { $count = count($tokens); $tagCount = 0; diff --git a/src/DocBlock/StandardTagFactory.php b/src/DocBlock/StandardTagFactory.php index eda7c53..0a65646 100644 --- a/src/DocBlock/StandardTagFactory.php +++ b/src/DocBlock/StandardTagFactory.php @@ -15,7 +15,7 @@ namespace phpDocumentor\Reflection\DocBlock; use phpDocumentor\Reflection\DocBlock\Tags\Factory\StaticMethod; use phpDocumentor\Reflection\DocBlock\Tags\Generic; use phpDocumentor\Reflection\FqsenResolver; -use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\Context as TypeContext; use Webmozart\Assert\Assert; /** @@ -105,10 +105,10 @@ final class StandardTagFactory implements TagFactory /** * {@inheritDoc} */ - public function create($tagLine, Context $context = null) + public function create($tagLine, TypeContext $context = null) { if (! $context) { - $context = new Context(''); + $context = new TypeContext(''); } list($tagName, $tagBody) = $this->extractTagParts($tagLine); @@ -180,11 +180,11 @@ final class StandardTagFactory implements TagFactory * * @param string $body * @param string $name - * @param Context $context + * @param TypeContext $context * * @return Tag|null */ - private function createTag($body, $name, Context $context) + private function createTag($body, $name, TypeContext $context) { $handlerClassName = $this->findHandlerClassName($name, $context); $arguments = $this->getArgumentsForParametersFromWiring( @@ -200,11 +200,11 @@ final class StandardTagFactory implements TagFactory * Determines the Fully Qualified Class Name of the Factory or Tag (containing a Factory Method `create`). * * @param string $tagName - * @param Context $context + * @param TypeContext $context * * @return string */ - private function findHandlerClassName($tagName, Context $context) + private function findHandlerClassName($tagName, TypeContext $context) { $handlerClassName = Generic::class; if (isset($this->tagHandlerMappings[$tagName])) { @@ -273,20 +273,20 @@ final class StandardTagFactory implements TagFactory * Returns a copy of this class' Service Locator with added dynamic parameters, such as the tag's name, body and * Context. * - * @param Context $context The Context (namespace and aliasses) that may be passed and is used to resolve FQSENs. - * @param string $tagName The name of the tag that may be passed onto the factory method of the Tag class. - * @param string $tagBody The body of the tag that may be passed onto the factory method of the Tag class. + * @param TypeContext $context The Context (namespace and aliasses) that may be passed and is used to resolve FQSENs. + * @param string $tagName The name of the tag that may be passed onto the factory method of the Tag class. + * @param string $tagBody The body of the tag that may be passed onto the factory method of the Tag class. * * @return mixed[] */ - private function getServiceLocatorWithDynamicParameters(Context $context, $tagName, $tagBody) + private function getServiceLocatorWithDynamicParameters(TypeContext $context, $tagName, $tagBody) { $locator = array_merge( $this->serviceLocator, [ - 'name' => $tagName, - 'body' => $tagBody, - Context::class => $context + 'name' => $tagName, + 'body' => $tagBody, + TypeContext::class => $context ] ); diff --git a/src/DocBlock/TagFactory.php b/src/DocBlock/TagFactory.php index b1a7fcf..3c1d113 100644 --- a/src/DocBlock/TagFactory.php +++ b/src/DocBlock/TagFactory.php @@ -12,7 +12,7 @@ namespace phpDocumentor\Reflection\DocBlock; -use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\Context as TypeContext; interface TagFactory { @@ -61,13 +61,13 @@ interface TagFactory * Factory method responsible for instantiating the correct sub type. * * @param string $tagLine The text for this tag, including description. - * @param Context $context + * @param TypeContext $context * * @throws \InvalidArgumentException if an invalid tag line was presented. * * @return Tag A new tag object. */ - public function create($tagLine, Context $context = null); + public function create($tagLine, TypeContext $context = null); /** * Registers a handler for tags. diff --git a/src/DocBlock/Tags/Covers.php b/src/DocBlock/Tags/Covers.php index 0465a6a..31b4f82 100644 --- a/src/DocBlock/Tags/Covers.php +++ b/src/DocBlock/Tags/Covers.php @@ -15,7 +15,7 @@ namespace phpDocumentor\Reflection\DocBlock\Tags; use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\Fqsen; use phpDocumentor\Reflection\DocBlock\Description; -use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\Context as TypeContext; use phpDocumentor\Reflection\FqsenResolver; use Webmozart\Assert\Assert; @@ -48,7 +48,7 @@ final class Covers extends BaseTag implements Factory\StaticMethod $body, DescriptionFactory $descriptionFactory = null, FqsenResolver $resolver = null, - Context $context = null + TypeContext $context = null ) { Assert::string($body); diff --git a/src/DocBlock/Tags/Deprecated.php b/src/DocBlock/Tags/Deprecated.php index ab4fb41..d3a0bd7 100644 --- a/src/DocBlock/Tags/Deprecated.php +++ b/src/DocBlock/Tags/Deprecated.php @@ -12,7 +12,7 @@ namespace phpDocumentor\Reflection\DocBlock\Tags; -use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\Context as TypeContext; use phpDocumentor\Reflection\DocBlock\Description; use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use Webmozart\Assert\Assert; @@ -54,7 +54,7 @@ final class Deprecated extends BaseTag implements Factory\StaticMethod /** * @return static */ - public static function create($body, DescriptionFactory $descriptionFactory = null, Context $context = null) + public static function create($body, DescriptionFactory $descriptionFactory = null, TypeContext $context = null) { Assert::nullOrString($body); if (empty($body)) { diff --git a/src/DocBlock/Tags/Generic.php b/src/DocBlock/Tags/Generic.php index 25c4856..e4c53e0 100644 --- a/src/DocBlock/Tags/Generic.php +++ b/src/DocBlock/Tags/Generic.php @@ -15,7 +15,7 @@ namespace phpDocumentor\Reflection\DocBlock\Tags; use phpDocumentor\Reflection\DocBlock\Description; use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\DocBlock\StandardTagFactory; -use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\Context as TypeContext; use Webmozart\Assert\Assert; /** @@ -43,7 +43,7 @@ class Generic extends BaseTag implements Factory\StaticMethod * @param string $body * @param string $name * @param DescriptionFactory $descriptionFactory - * @param Context $context + * @param TypeContext $context * * @return static */ @@ -51,7 +51,7 @@ class Generic extends BaseTag implements Factory\StaticMethod $body, $name = '', DescriptionFactory $descriptionFactory = null, - Context $context = null + TypeContext $context = null ) { Assert::string($body); Assert::stringNotEmpty($name); diff --git a/src/DocBlock/Tags/Link.php b/src/DocBlock/Tags/Link.php index ccc0e2d..9c0e367 100644 --- a/src/DocBlock/Tags/Link.php +++ b/src/DocBlock/Tags/Link.php @@ -14,7 +14,7 @@ namespace phpDocumentor\Reflection\DocBlock\Tags; use phpDocumentor\Reflection\DocBlock\Description; use phpDocumentor\Reflection\DocBlock\DescriptionFactory; -use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\Context as TypeContext; use Webmozart\Assert\Assert; /** @@ -44,7 +44,7 @@ final class Link extends BaseTag implements Factory\StaticMethod /** * {@inheritdoc} */ - public static function create($body, DescriptionFactory $descriptionFactory = null, Context $context = null) + public static function create($body, DescriptionFactory $descriptionFactory = null, TypeContext $context = null) { Assert::string($body); Assert::notNull($descriptionFactory); diff --git a/src/DocBlock/Tags/Method.php b/src/DocBlock/Tags/Method.php index c0c9fa5..86b4286 100644 --- a/src/DocBlock/Tags/Method.php +++ b/src/DocBlock/Tags/Method.php @@ -16,7 +16,7 @@ use phpDocumentor\Reflection\DocBlock\Description; use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\Type; use phpDocumentor\Reflection\TypeResolver; -use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\Context as TypeContext; use phpDocumentor\Reflection\Types\Void; use Webmozart\Assert\Assert; @@ -67,7 +67,7 @@ final class Method extends BaseTag implements Factory\StaticMethod $body, TypeResolver $typeResolver = null, DescriptionFactory $descriptionFactory = null, - Context $context = null + TypeContext $context = null ) { Assert::stringNotEmpty($body); Assert::allNotNull([ $typeResolver, $descriptionFactory ]); diff --git a/src/DocBlock/Tags/Param.php b/src/DocBlock/Tags/Param.php index 7a94e73..1a51dc0 100644 --- a/src/DocBlock/Tags/Param.php +++ b/src/DocBlock/Tags/Param.php @@ -16,7 +16,7 @@ use phpDocumentor\Reflection\DocBlock\Description; use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\Type; use phpDocumentor\Reflection\TypeResolver; -use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\Context as TypeContext; use Webmozart\Assert\Assert; /** @@ -60,9 +60,8 @@ final class Param extends BaseTag implements Factory\StaticMethod $body, TypeResolver $typeResolver = null, DescriptionFactory $descriptionFactory = null, - Context $context = null - ) - { + TypeContext $context = null + ) { Assert::stringNotEmpty($body); Assert::allNotNull([$typeResolver, $descriptionFactory]); diff --git a/src/DocBlock/Tags/Property.php b/src/DocBlock/Tags/Property.php index 23205e1..3c59713 100644 --- a/src/DocBlock/Tags/Property.php +++ b/src/DocBlock/Tags/Property.php @@ -16,7 +16,7 @@ use phpDocumentor\Reflection\DocBlock\Description; use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\Type; use phpDocumentor\Reflection\TypeResolver; -use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\Context as TypeContext; use Webmozart\Assert\Assert; /** @@ -54,7 +54,7 @@ class Property extends BaseTag implements Factory\StaticMethod $body, TypeResolver $typeResolver = null, DescriptionFactory $descriptionFactory = null, - Context $context = null + TypeContext $context = null ) { Assert::stringNotEmpty($body); Assert::allNotNull([$typeResolver, $descriptionFactory]); diff --git a/src/DocBlock/Tags/PropertyRead.php b/src/DocBlock/Tags/PropertyRead.php index 1711357..bf2b805 100644 --- a/src/DocBlock/Tags/PropertyRead.php +++ b/src/DocBlock/Tags/PropertyRead.php @@ -16,7 +16,7 @@ use phpDocumentor\Reflection\DocBlock\Description; use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\Type; use phpDocumentor\Reflection\TypeResolver; -use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\Context as TypeContext; use Webmozart\Assert\Assert; /** @@ -54,7 +54,7 @@ class PropertyRead extends BaseTag implements Factory\StaticMethod $body, TypeResolver $typeResolver = null, DescriptionFactory $descriptionFactory = null, - Context $context = null + TypeContext $context = null ) { Assert::stringNotEmpty($body); Assert::allNotNull([$typeResolver, $descriptionFactory]); diff --git a/src/DocBlock/Tags/PropertyWrite.php b/src/DocBlock/Tags/PropertyWrite.php index acf2ea9..db37e0f 100644 --- a/src/DocBlock/Tags/PropertyWrite.php +++ b/src/DocBlock/Tags/PropertyWrite.php @@ -16,7 +16,7 @@ use phpDocumentor\Reflection\DocBlock\Description; use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\Type; use phpDocumentor\Reflection\TypeResolver; -use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\Context as TypeContext; use Webmozart\Assert\Assert; /** @@ -54,7 +54,7 @@ class PropertyWrite extends BaseTag implements Factory\StaticMethod $body, TypeResolver $typeResolver = null, DescriptionFactory $descriptionFactory = null, - Context $context = null + TypeContext $context = null ) { Assert::stringNotEmpty($body); Assert::allNotNull([$typeResolver, $descriptionFactory]); diff --git a/src/DocBlock/Tags/Return_.php b/src/DocBlock/Tags/Return_.php index 58e0eac..09a5870 100644 --- a/src/DocBlock/Tags/Return_.php +++ b/src/DocBlock/Tags/Return_.php @@ -16,7 +16,7 @@ use phpDocumentor\Reflection\DocBlock\Description; use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\Type; use phpDocumentor\Reflection\TypeResolver; -use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\Context as TypeContext; use Webmozart\Assert\Assert; /** @@ -42,7 +42,7 @@ final class Return_ extends BaseTag implements Factory\StaticMethod $body, TypeResolver $typeResolver = null, DescriptionFactory $descriptionFactory = null, - Context $context = null + TypeContext $context = null ) { Assert::string($body); diff --git a/src/DocBlock/Tags/See.php b/src/DocBlock/Tags/See.php index 709ad1f..64ee3d8 100644 --- a/src/DocBlock/Tags/See.php +++ b/src/DocBlock/Tags/See.php @@ -15,7 +15,7 @@ namespace phpDocumentor\Reflection\DocBlock\Tags; use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\Fqsen; use phpDocumentor\Reflection\FqsenResolver; -use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\Context as TypeContext; use phpDocumentor\Reflection\DocBlock\Description; use Webmozart\Assert\Assert; @@ -48,7 +48,7 @@ class See extends BaseTag implements Factory\StaticMethod $body, FqsenResolver $resolver = null, DescriptionFactory $descriptionFactory = null, - Context $context = null + TypeContext $context = null ) { Assert::string($body); Assert::allNotNull([$resolver, $descriptionFactory]); diff --git a/src/DocBlock/Tags/Since.php b/src/DocBlock/Tags/Since.php index 37f4876..3d002ed 100644 --- a/src/DocBlock/Tags/Since.php +++ b/src/DocBlock/Tags/Since.php @@ -12,7 +12,7 @@ namespace phpDocumentor\Reflection\DocBlock\Tags; -use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\Context as TypeContext; use phpDocumentor\Reflection\DocBlock\Description; use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use Webmozart\Assert\Assert; @@ -54,7 +54,7 @@ final class Since extends BaseTag implements Factory\StaticMethod /** * @return static */ - public static function create($body, DescriptionFactory $descriptionFactory = null, Context $context = null) + public static function create($body, DescriptionFactory $descriptionFactory = null, TypeContext $context = null) { Assert::nullOrString($body); if (empty($body)) { diff --git a/src/DocBlock/Tags/Source.php b/src/DocBlock/Tags/Source.php index 39f44ba..b0646b9 100644 --- a/src/DocBlock/Tags/Source.php +++ b/src/DocBlock/Tags/Source.php @@ -14,7 +14,7 @@ namespace phpDocumentor\Reflection\DocBlock\Tags; use phpDocumentor\Reflection\DocBlock\Description; use phpDocumentor\Reflection\DocBlock\DescriptionFactory; -use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\Context as TypeContext; use Webmozart\Assert\Assert; /** @@ -44,7 +44,7 @@ final class Source extends BaseTag implements Factory\StaticMethod /** * {@inheritdoc} */ - public static function create($body, DescriptionFactory $descriptionFactory = null, Context $context = null) + public static function create($body, DescriptionFactory $descriptionFactory = null, TypeContext $context = null) { Assert::stringNotEmpty($body); Assert::notNull($descriptionFactory); diff --git a/src/DocBlock/Tags/Throws.php b/src/DocBlock/Tags/Throws.php index 5984ddb..349e773 100644 --- a/src/DocBlock/Tags/Throws.php +++ b/src/DocBlock/Tags/Throws.php @@ -16,7 +16,7 @@ use phpDocumentor\Reflection\DocBlock\Description; use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\Type; use phpDocumentor\Reflection\TypeResolver; -use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\Context as TypeContext; use Webmozart\Assert\Assert; /** @@ -42,7 +42,7 @@ final class Throws extends BaseTag implements Factory\StaticMethod $body, TypeResolver $typeResolver = null, DescriptionFactory $descriptionFactory = null, - Context $context = null + TypeContext $context = null ) { Assert::string($body); Assert::allNotNull([$typeResolver, $descriptionFactory]); diff --git a/src/DocBlock/Tags/Uses.php b/src/DocBlock/Tags/Uses.php index 0b15cab..00dc3e3 100644 --- a/src/DocBlock/Tags/Uses.php +++ b/src/DocBlock/Tags/Uses.php @@ -16,7 +16,7 @@ use phpDocumentor\Reflection\DocBlock\Description; use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\Fqsen; use phpDocumentor\Reflection\FqsenResolver; -use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\Context as TypeContext; use Webmozart\Assert\Assert; /** @@ -48,7 +48,7 @@ final class Uses extends BaseTag implements Factory\StaticMethod $body, FqsenResolver $resolver = null, DescriptionFactory $descriptionFactory = null, - Context $context = null + TypeContext $context = null ) { Assert::string($body); Assert::allNotNull([$resolver, $descriptionFactory]); diff --git a/src/DocBlock/Tags/Var_.php b/src/DocBlock/Tags/Var_.php index bc1b592..e23c694 100644 --- a/src/DocBlock/Tags/Var_.php +++ b/src/DocBlock/Tags/Var_.php @@ -16,7 +16,7 @@ use phpDocumentor\Reflection\DocBlock\Description; use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\Type; use phpDocumentor\Reflection\TypeResolver; -use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\Context as TypeContext; use Webmozart\Assert\Assert; /** @@ -54,7 +54,7 @@ class Var_ extends BaseTag implements Factory\StaticMethod $body, TypeResolver $typeResolver = null, DescriptionFactory $descriptionFactory = null, - Context $context = null + TypeContext $context = null ) { Assert::stringNotEmpty($body); Assert::allNotNull([$typeResolver, $descriptionFactory]); diff --git a/src/DocBlock/Tags/Version.php b/src/DocBlock/Tags/Version.php index 9da8896..3e0e5be 100644 --- a/src/DocBlock/Tags/Version.php +++ b/src/DocBlock/Tags/Version.php @@ -12,7 +12,7 @@ namespace phpDocumentor\Reflection\DocBlock\Tags; -use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\Context as TypeContext; use phpDocumentor\Reflection\DocBlock\Description; use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use Webmozart\Assert\Assert; @@ -54,7 +54,7 @@ final class Version extends BaseTag implements Factory\StaticMethod /** * @return static */ - public static function create($body, DescriptionFactory $descriptionFactory = null, Context $context = null) + public static function create($body, DescriptionFactory $descriptionFactory = null, TypeContext $context = null) { Assert::nullOrString($body); if (empty($body)) { diff --git a/src/DocBlockFactory.php b/src/DocBlockFactory.php index 833f2ab..9ec2455 100644 --- a/src/DocBlockFactory.php +++ b/src/DocBlockFactory.php @@ -16,7 +16,6 @@ use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\DocBlock\StandardTagFactory; use phpDocumentor\Reflection\DocBlock\Tag; use phpDocumentor\Reflection\DocBlock\TagFactory; -use phpDocumentor\Reflection\Types\Context; use Webmozart\Assert\Assert; final class DocBlockFactory implements DocBlockFactoryInterface @@ -85,7 +84,7 @@ final class DocBlockFactory implements DocBlockFactoryInterface Assert::stringNotEmpty($docblock); if ($context === null) { - $context = new Context(''); + $context = new Types\Context(''); } $parts = $this->splitDocBlock($this->stripDocComment($docblock)); @@ -216,11 +215,11 @@ final class DocBlockFactory implements DocBlockFactoryInterface * Creates the tag objects. * * @param string $tags Tag block to parse. - * @param Context $context Context of the parsed Tag + * @param Types\Context $context Context of the parsed Tag * * @return DocBlock\Tag[] */ - private function parseTagBlock($tags, Context $context) + private function parseTagBlock($tags, Types\Context $context) { $tags = $this->filterTagBlock($tags); if (!$tags) {