Add aliases for Context class because newer phpunit versions have a global Context class

This commit is contained in:
Mike van Riel
2016-02-26 21:44:16 +01:00
parent 332c96dab8
commit 52723f0fb8
22 changed files with 65 additions and 68 deletions
+4 -5
View File
@@ -13,7 +13,6 @@
namespace phpDocumentor\Reflection; namespace phpDocumentor\Reflection;
use phpDocumentor\Reflection\DocBlock\Tag; use phpDocumentor\Reflection\DocBlock\Tag;
use phpDocumentor\Reflection\Types\Context;
use Webmozart\Assert\Assert; use Webmozart\Assert\Assert;
final class DocBlock final class DocBlock
@@ -27,7 +26,7 @@ final class DocBlock
/** @var Tag[] An array containing all the tags in this docblock; except inline. */ /** @var Tag[] An array containing all the tags in this docblock; except inline. */
private $tags = array(); 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; private $context = null;
/** @var Location Information about the location of this DocBlock. */ /** @var Location Information about the location of this DocBlock. */
@@ -43,7 +42,7 @@ final class DocBlock
* @param string $summary * @param string $summary
* @param DocBlock\Description $description * @param DocBlock\Description $description
* @param DocBlock\Tag[] $tags * @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 Location $location The location within the file that this DocBlock occurs in.
* @param bool $isTemplateStart * @param bool $isTemplateStart
* @param bool $isTemplateEnd * @param bool $isTemplateEnd
@@ -52,7 +51,7 @@ final class DocBlock
$summary = '', $summary = '',
DocBlock\Description $description = null, DocBlock\Description $description = null,
array $tags = [], array $tags = [],
Context $context = null, Types\Context $context = null,
Location $location = null, Location $location = null,
$isTemplateStart = false, $isTemplateStart = false,
$isTemplateEnd = false $isTemplateEnd = false
@@ -95,7 +94,7 @@ final class DocBlock
/** /**
* Returns the current context. * Returns the current context.
* *
* @return Context * @return Types\Context
*/ */
public function getContext() public function getContext()
{ {
+5 -5
View File
@@ -12,7 +12,7 @@
namespace phpDocumentor\Reflection\DocBlock; 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. * Creates a new Description object given a body of text.
@@ -50,11 +50,11 @@ class DescriptionFactory
* Returns the parsed text of this description. * Returns the parsed text of this description.
* *
* @param string $contents * @param string $contents
* @param Context $context * @param TypeContext $context
* *
* @return Description * @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); 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. * Parses the stream of tokens in to a new set of tokens containing Tags.
* *
* @param string[] $tokens * @param string[] $tokens
* @param Context $context * @param TypeContext $context
* *
* @return string[]|Tag[] * @return string[]|Tag[]
*/ */
private function parse($tokens, Context $context) private function parse($tokens, TypeContext $context)
{ {
$count = count($tokens); $count = count($tokens);
$tagCount = 0; $tagCount = 0;
+14 -14
View File
@@ -15,7 +15,7 @@ namespace phpDocumentor\Reflection\DocBlock;
use phpDocumentor\Reflection\DocBlock\Tags\Factory\StaticMethod; use phpDocumentor\Reflection\DocBlock\Tags\Factory\StaticMethod;
use phpDocumentor\Reflection\DocBlock\Tags\Generic; use phpDocumentor\Reflection\DocBlock\Tags\Generic;
use phpDocumentor\Reflection\FqsenResolver; use phpDocumentor\Reflection\FqsenResolver;
use phpDocumentor\Reflection\Types\Context; use phpDocumentor\Reflection\Types\Context as TypeContext;
use Webmozart\Assert\Assert; use Webmozart\Assert\Assert;
/** /**
@@ -105,10 +105,10 @@ final class StandardTagFactory implements TagFactory
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function create($tagLine, Context $context = null) public function create($tagLine, TypeContext $context = null)
{ {
if (! $context) { if (! $context) {
$context = new Context(''); $context = new TypeContext('');
} }
list($tagName, $tagBody) = $this->extractTagParts($tagLine); list($tagName, $tagBody) = $this->extractTagParts($tagLine);
@@ -180,11 +180,11 @@ final class StandardTagFactory implements TagFactory
* *
* @param string $body * @param string $body
* @param string $name * @param string $name
* @param Context $context * @param TypeContext $context
* *
* @return Tag|null * @return Tag|null
*/ */
private function createTag($body, $name, Context $context) private function createTag($body, $name, TypeContext $context)
{ {
$handlerClassName = $this->findHandlerClassName($name, $context); $handlerClassName = $this->findHandlerClassName($name, $context);
$arguments = $this->getArgumentsForParametersFromWiring( $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`). * Determines the Fully Qualified Class Name of the Factory or Tag (containing a Factory Method `create`).
* *
* @param string $tagName * @param string $tagName
* @param Context $context * @param TypeContext $context
* *
* @return string * @return string
*/ */
private function findHandlerClassName($tagName, Context $context) private function findHandlerClassName($tagName, TypeContext $context)
{ {
$handlerClassName = Generic::class; $handlerClassName = Generic::class;
if (isset($this->tagHandlerMappings[$tagName])) { 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 * Returns a copy of this class' Service Locator with added dynamic parameters, such as the tag's name, body and
* Context. * Context.
* *
* @param Context $context The Context (namespace and aliasses) that may be passed and is used to resolve FQSENs. * @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 $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 string $tagBody The body of the tag that may be passed onto the factory method of the Tag class.
* *
* @return mixed[] * @return mixed[]
*/ */
private function getServiceLocatorWithDynamicParameters(Context $context, $tagName, $tagBody) private function getServiceLocatorWithDynamicParameters(TypeContext $context, $tagName, $tagBody)
{ {
$locator = array_merge( $locator = array_merge(
$this->serviceLocator, $this->serviceLocator,
[ [
'name' => $tagName, 'name' => $tagName,
'body' => $tagBody, 'body' => $tagBody,
Context::class => $context TypeContext::class => $context
] ]
); );
+3 -3
View File
@@ -12,7 +12,7 @@
namespace phpDocumentor\Reflection\DocBlock; namespace phpDocumentor\Reflection\DocBlock;
use phpDocumentor\Reflection\Types\Context; use phpDocumentor\Reflection\Types\Context as TypeContext;
interface TagFactory interface TagFactory
{ {
@@ -61,13 +61,13 @@ interface TagFactory
* Factory method responsible for instantiating the correct sub type. * Factory method responsible for instantiating the correct sub type.
* *
* @param string $tagLine The text for this tag, including description. * @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. * @throws \InvalidArgumentException if an invalid tag line was presented.
* *
* @return Tag A new tag object. * @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. * Registers a handler for tags.
+2 -2
View File
@@ -15,7 +15,7 @@ namespace phpDocumentor\Reflection\DocBlock\Tags;
use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
use phpDocumentor\Reflection\Fqsen; use phpDocumentor\Reflection\Fqsen;
use phpDocumentor\Reflection\DocBlock\Description; use phpDocumentor\Reflection\DocBlock\Description;
use phpDocumentor\Reflection\Types\Context; use phpDocumentor\Reflection\Types\Context as TypeContext;
use phpDocumentor\Reflection\FqsenResolver; use phpDocumentor\Reflection\FqsenResolver;
use Webmozart\Assert\Assert; use Webmozart\Assert\Assert;
@@ -48,7 +48,7 @@ final class Covers extends BaseTag implements Factory\StaticMethod
$body, $body,
DescriptionFactory $descriptionFactory = null, DescriptionFactory $descriptionFactory = null,
FqsenResolver $resolver = null, FqsenResolver $resolver = null,
Context $context = null TypeContext $context = null
) )
{ {
Assert::string($body); Assert::string($body);
+2 -2
View File
@@ -12,7 +12,7 @@
namespace phpDocumentor\Reflection\DocBlock\Tags; 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\Description;
use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
use Webmozart\Assert\Assert; use Webmozart\Assert\Assert;
@@ -54,7 +54,7 @@ final class Deprecated extends BaseTag implements Factory\StaticMethod
/** /**
* @return static * @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); Assert::nullOrString($body);
if (empty($body)) { if (empty($body)) {
+3 -3
View File
@@ -15,7 +15,7 @@ namespace phpDocumentor\Reflection\DocBlock\Tags;
use phpDocumentor\Reflection\DocBlock\Description; use phpDocumentor\Reflection\DocBlock\Description;
use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
use phpDocumentor\Reflection\DocBlock\StandardTagFactory; use phpDocumentor\Reflection\DocBlock\StandardTagFactory;
use phpDocumentor\Reflection\Types\Context; use phpDocumentor\Reflection\Types\Context as TypeContext;
use Webmozart\Assert\Assert; use Webmozart\Assert\Assert;
/** /**
@@ -43,7 +43,7 @@ class Generic extends BaseTag implements Factory\StaticMethod
* @param string $body * @param string $body
* @param string $name * @param string $name
* @param DescriptionFactory $descriptionFactory * @param DescriptionFactory $descriptionFactory
* @param Context $context * @param TypeContext $context
* *
* @return static * @return static
*/ */
@@ -51,7 +51,7 @@ class Generic extends BaseTag implements Factory\StaticMethod
$body, $body,
$name = '', $name = '',
DescriptionFactory $descriptionFactory = null, DescriptionFactory $descriptionFactory = null,
Context $context = null TypeContext $context = null
) { ) {
Assert::string($body); Assert::string($body);
Assert::stringNotEmpty($name); Assert::stringNotEmpty($name);
+2 -2
View File
@@ -14,7 +14,7 @@ namespace phpDocumentor\Reflection\DocBlock\Tags;
use phpDocumentor\Reflection\DocBlock\Description; use phpDocumentor\Reflection\DocBlock\Description;
use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
use phpDocumentor\Reflection\Types\Context; use phpDocumentor\Reflection\Types\Context as TypeContext;
use Webmozart\Assert\Assert; use Webmozart\Assert\Assert;
/** /**
@@ -44,7 +44,7 @@ final class Link extends BaseTag implements Factory\StaticMethod
/** /**
* {@inheritdoc} * {@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::string($body);
Assert::notNull($descriptionFactory); Assert::notNull($descriptionFactory);
+2 -2
View File
@@ -16,7 +16,7 @@ use phpDocumentor\Reflection\DocBlock\Description;
use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
use phpDocumentor\Reflection\Type; use phpDocumentor\Reflection\Type;
use phpDocumentor\Reflection\TypeResolver; use phpDocumentor\Reflection\TypeResolver;
use phpDocumentor\Reflection\Types\Context; use phpDocumentor\Reflection\Types\Context as TypeContext;
use phpDocumentor\Reflection\Types\Void; use phpDocumentor\Reflection\Types\Void;
use Webmozart\Assert\Assert; use Webmozart\Assert\Assert;
@@ -67,7 +67,7 @@ final class Method extends BaseTag implements Factory\StaticMethod
$body, $body,
TypeResolver $typeResolver = null, TypeResolver $typeResolver = null,
DescriptionFactory $descriptionFactory = null, DescriptionFactory $descriptionFactory = null,
Context $context = null TypeContext $context = null
) { ) {
Assert::stringNotEmpty($body); Assert::stringNotEmpty($body);
Assert::allNotNull([ $typeResolver, $descriptionFactory ]); Assert::allNotNull([ $typeResolver, $descriptionFactory ]);
+3 -4
View File
@@ -16,7 +16,7 @@ use phpDocumentor\Reflection\DocBlock\Description;
use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
use phpDocumentor\Reflection\Type; use phpDocumentor\Reflection\Type;
use phpDocumentor\Reflection\TypeResolver; use phpDocumentor\Reflection\TypeResolver;
use phpDocumentor\Reflection\Types\Context; use phpDocumentor\Reflection\Types\Context as TypeContext;
use Webmozart\Assert\Assert; use Webmozart\Assert\Assert;
/** /**
@@ -60,9 +60,8 @@ final class Param extends BaseTag implements Factory\StaticMethod
$body, $body,
TypeResolver $typeResolver = null, TypeResolver $typeResolver = null,
DescriptionFactory $descriptionFactory = null, DescriptionFactory $descriptionFactory = null,
Context $context = null TypeContext $context = null
) ) {
{
Assert::stringNotEmpty($body); Assert::stringNotEmpty($body);
Assert::allNotNull([$typeResolver, $descriptionFactory]); Assert::allNotNull([$typeResolver, $descriptionFactory]);
+2 -2
View File
@@ -16,7 +16,7 @@ use phpDocumentor\Reflection\DocBlock\Description;
use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
use phpDocumentor\Reflection\Type; use phpDocumentor\Reflection\Type;
use phpDocumentor\Reflection\TypeResolver; use phpDocumentor\Reflection\TypeResolver;
use phpDocumentor\Reflection\Types\Context; use phpDocumentor\Reflection\Types\Context as TypeContext;
use Webmozart\Assert\Assert; use Webmozart\Assert\Assert;
/** /**
@@ -54,7 +54,7 @@ class Property extends BaseTag implements Factory\StaticMethod
$body, $body,
TypeResolver $typeResolver = null, TypeResolver $typeResolver = null,
DescriptionFactory $descriptionFactory = null, DescriptionFactory $descriptionFactory = null,
Context $context = null TypeContext $context = null
) { ) {
Assert::stringNotEmpty($body); Assert::stringNotEmpty($body);
Assert::allNotNull([$typeResolver, $descriptionFactory]); Assert::allNotNull([$typeResolver, $descriptionFactory]);
+2 -2
View File
@@ -16,7 +16,7 @@ use phpDocumentor\Reflection\DocBlock\Description;
use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
use phpDocumentor\Reflection\Type; use phpDocumentor\Reflection\Type;
use phpDocumentor\Reflection\TypeResolver; use phpDocumentor\Reflection\TypeResolver;
use phpDocumentor\Reflection\Types\Context; use phpDocumentor\Reflection\Types\Context as TypeContext;
use Webmozart\Assert\Assert; use Webmozart\Assert\Assert;
/** /**
@@ -54,7 +54,7 @@ class PropertyRead extends BaseTag implements Factory\StaticMethod
$body, $body,
TypeResolver $typeResolver = null, TypeResolver $typeResolver = null,
DescriptionFactory $descriptionFactory = null, DescriptionFactory $descriptionFactory = null,
Context $context = null TypeContext $context = null
) { ) {
Assert::stringNotEmpty($body); Assert::stringNotEmpty($body);
Assert::allNotNull([$typeResolver, $descriptionFactory]); Assert::allNotNull([$typeResolver, $descriptionFactory]);
+2 -2
View File
@@ -16,7 +16,7 @@ use phpDocumentor\Reflection\DocBlock\Description;
use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
use phpDocumentor\Reflection\Type; use phpDocumentor\Reflection\Type;
use phpDocumentor\Reflection\TypeResolver; use phpDocumentor\Reflection\TypeResolver;
use phpDocumentor\Reflection\Types\Context; use phpDocumentor\Reflection\Types\Context as TypeContext;
use Webmozart\Assert\Assert; use Webmozart\Assert\Assert;
/** /**
@@ -54,7 +54,7 @@ class PropertyWrite extends BaseTag implements Factory\StaticMethod
$body, $body,
TypeResolver $typeResolver = null, TypeResolver $typeResolver = null,
DescriptionFactory $descriptionFactory = null, DescriptionFactory $descriptionFactory = null,
Context $context = null TypeContext $context = null
) { ) {
Assert::stringNotEmpty($body); Assert::stringNotEmpty($body);
Assert::allNotNull([$typeResolver, $descriptionFactory]); Assert::allNotNull([$typeResolver, $descriptionFactory]);
+2 -2
View File
@@ -16,7 +16,7 @@ use phpDocumentor\Reflection\DocBlock\Description;
use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
use phpDocumentor\Reflection\Type; use phpDocumentor\Reflection\Type;
use phpDocumentor\Reflection\TypeResolver; use phpDocumentor\Reflection\TypeResolver;
use phpDocumentor\Reflection\Types\Context; use phpDocumentor\Reflection\Types\Context as TypeContext;
use Webmozart\Assert\Assert; use Webmozart\Assert\Assert;
/** /**
@@ -42,7 +42,7 @@ final class Return_ extends BaseTag implements Factory\StaticMethod
$body, $body,
TypeResolver $typeResolver = null, TypeResolver $typeResolver = null,
DescriptionFactory $descriptionFactory = null, DescriptionFactory $descriptionFactory = null,
Context $context = null TypeContext $context = null
) )
{ {
Assert::string($body); Assert::string($body);
+2 -2
View File
@@ -15,7 +15,7 @@ namespace phpDocumentor\Reflection\DocBlock\Tags;
use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
use phpDocumentor\Reflection\Fqsen; use phpDocumentor\Reflection\Fqsen;
use phpDocumentor\Reflection\FqsenResolver; use phpDocumentor\Reflection\FqsenResolver;
use phpDocumentor\Reflection\Types\Context; use phpDocumentor\Reflection\Types\Context as TypeContext;
use phpDocumentor\Reflection\DocBlock\Description; use phpDocumentor\Reflection\DocBlock\Description;
use Webmozart\Assert\Assert; use Webmozart\Assert\Assert;
@@ -48,7 +48,7 @@ class See extends BaseTag implements Factory\StaticMethod
$body, $body,
FqsenResolver $resolver = null, FqsenResolver $resolver = null,
DescriptionFactory $descriptionFactory = null, DescriptionFactory $descriptionFactory = null,
Context $context = null TypeContext $context = null
) { ) {
Assert::string($body); Assert::string($body);
Assert::allNotNull([$resolver, $descriptionFactory]); Assert::allNotNull([$resolver, $descriptionFactory]);
+2 -2
View File
@@ -12,7 +12,7 @@
namespace phpDocumentor\Reflection\DocBlock\Tags; 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\Description;
use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
use Webmozart\Assert\Assert; use Webmozart\Assert\Assert;
@@ -54,7 +54,7 @@ final class Since extends BaseTag implements Factory\StaticMethod
/** /**
* @return static * @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); Assert::nullOrString($body);
if (empty($body)) { if (empty($body)) {
+2 -2
View File
@@ -14,7 +14,7 @@ namespace phpDocumentor\Reflection\DocBlock\Tags;
use phpDocumentor\Reflection\DocBlock\Description; use phpDocumentor\Reflection\DocBlock\Description;
use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
use phpDocumentor\Reflection\Types\Context; use phpDocumentor\Reflection\Types\Context as TypeContext;
use Webmozart\Assert\Assert; use Webmozart\Assert\Assert;
/** /**
@@ -44,7 +44,7 @@ final class Source extends BaseTag implements Factory\StaticMethod
/** /**
* {@inheritdoc} * {@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::stringNotEmpty($body);
Assert::notNull($descriptionFactory); Assert::notNull($descriptionFactory);
+2 -2
View File
@@ -16,7 +16,7 @@ use phpDocumentor\Reflection\DocBlock\Description;
use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
use phpDocumentor\Reflection\Type; use phpDocumentor\Reflection\Type;
use phpDocumentor\Reflection\TypeResolver; use phpDocumentor\Reflection\TypeResolver;
use phpDocumentor\Reflection\Types\Context; use phpDocumentor\Reflection\Types\Context as TypeContext;
use Webmozart\Assert\Assert; use Webmozart\Assert\Assert;
/** /**
@@ -42,7 +42,7 @@ final class Throws extends BaseTag implements Factory\StaticMethod
$body, $body,
TypeResolver $typeResolver = null, TypeResolver $typeResolver = null,
DescriptionFactory $descriptionFactory = null, DescriptionFactory $descriptionFactory = null,
Context $context = null TypeContext $context = null
) { ) {
Assert::string($body); Assert::string($body);
Assert::allNotNull([$typeResolver, $descriptionFactory]); Assert::allNotNull([$typeResolver, $descriptionFactory]);
+2 -2
View File
@@ -16,7 +16,7 @@ use phpDocumentor\Reflection\DocBlock\Description;
use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
use phpDocumentor\Reflection\Fqsen; use phpDocumentor\Reflection\Fqsen;
use phpDocumentor\Reflection\FqsenResolver; use phpDocumentor\Reflection\FqsenResolver;
use phpDocumentor\Reflection\Types\Context; use phpDocumentor\Reflection\Types\Context as TypeContext;
use Webmozart\Assert\Assert; use Webmozart\Assert\Assert;
/** /**
@@ -48,7 +48,7 @@ final class Uses extends BaseTag implements Factory\StaticMethod
$body, $body,
FqsenResolver $resolver = null, FqsenResolver $resolver = null,
DescriptionFactory $descriptionFactory = null, DescriptionFactory $descriptionFactory = null,
Context $context = null TypeContext $context = null
) { ) {
Assert::string($body); Assert::string($body);
Assert::allNotNull([$resolver, $descriptionFactory]); Assert::allNotNull([$resolver, $descriptionFactory]);
+2 -2
View File
@@ -16,7 +16,7 @@ use phpDocumentor\Reflection\DocBlock\Description;
use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
use phpDocumentor\Reflection\Type; use phpDocumentor\Reflection\Type;
use phpDocumentor\Reflection\TypeResolver; use phpDocumentor\Reflection\TypeResolver;
use phpDocumentor\Reflection\Types\Context; use phpDocumentor\Reflection\Types\Context as TypeContext;
use Webmozart\Assert\Assert; use Webmozart\Assert\Assert;
/** /**
@@ -54,7 +54,7 @@ class Var_ extends BaseTag implements Factory\StaticMethod
$body, $body,
TypeResolver $typeResolver = null, TypeResolver $typeResolver = null,
DescriptionFactory $descriptionFactory = null, DescriptionFactory $descriptionFactory = null,
Context $context = null TypeContext $context = null
) { ) {
Assert::stringNotEmpty($body); Assert::stringNotEmpty($body);
Assert::allNotNull([$typeResolver, $descriptionFactory]); Assert::allNotNull([$typeResolver, $descriptionFactory]);
+2 -2
View File
@@ -12,7 +12,7 @@
namespace phpDocumentor\Reflection\DocBlock\Tags; 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\Description;
use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
use Webmozart\Assert\Assert; use Webmozart\Assert\Assert;
@@ -54,7 +54,7 @@ final class Version extends BaseTag implements Factory\StaticMethod
/** /**
* @return static * @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); Assert::nullOrString($body);
if (empty($body)) { if (empty($body)) {
+3 -4
View File
@@ -16,7 +16,6 @@ use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
use phpDocumentor\Reflection\DocBlock\StandardTagFactory; use phpDocumentor\Reflection\DocBlock\StandardTagFactory;
use phpDocumentor\Reflection\DocBlock\Tag; use phpDocumentor\Reflection\DocBlock\Tag;
use phpDocumentor\Reflection\DocBlock\TagFactory; use phpDocumentor\Reflection\DocBlock\TagFactory;
use phpDocumentor\Reflection\Types\Context;
use Webmozart\Assert\Assert; use Webmozart\Assert\Assert;
final class DocBlockFactory implements DocBlockFactoryInterface final class DocBlockFactory implements DocBlockFactoryInterface
@@ -85,7 +84,7 @@ final class DocBlockFactory implements DocBlockFactoryInterface
Assert::stringNotEmpty($docblock); Assert::stringNotEmpty($docblock);
if ($context === null) { if ($context === null) {
$context = new Context(''); $context = new Types\Context('');
} }
$parts = $this->splitDocBlock($this->stripDocComment($docblock)); $parts = $this->splitDocBlock($this->stripDocComment($docblock));
@@ -216,11 +215,11 @@ final class DocBlockFactory implements DocBlockFactoryInterface
* Creates the tag objects. * Creates the tag objects.
* *
* @param string $tags Tag block to parse. * @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[] * @return DocBlock\Tag[]
*/ */
private function parseTagBlock($tags, Context $context) private function parseTagBlock($tags, Types\Context $context)
{ {
$tags = $this->filterTagBlock($tags); $tags = $this->filterTagBlock($tags);
if (!$tags) { if (!$tags) {