mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 01:57:13 +00:00
[cs] add and apply psr2
This commit is contained in:
committed by
Jaap van Otterdijk
parent
0294ce9b70
commit
a872e515bb
@@ -78,7 +78,8 @@ DESCRIPTION;
|
||||
*/
|
||||
|
||||
include(__DIR__ . '/../../examples/playing-with-descriptions/02-escaping.php');
|
||||
$this->assertSame(<<<'DESCRIPTION'
|
||||
$this->assertSame(
|
||||
<<<'DESCRIPTION'
|
||||
You can escape the @-sign by surrounding it with braces, for example: @. And escape a closing brace within an
|
||||
inline tag by adding an opening brace in front of it like this: }.
|
||||
|
||||
@@ -91,7 +92,6 @@ Do note that an {@internal inline tag that has an opening brace ({) does not bre
|
||||
DESCRIPTION
|
||||
,
|
||||
$foundDescription
|
||||
)
|
||||
;
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
namespace phpDocumentor\Reflection;
|
||||
|
||||
|
||||
/**
|
||||
* @coversNothing
|
||||
*/
|
||||
|
||||
@@ -73,8 +73,7 @@ class DescriptionFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
$tagFactory->shouldReceive('create')
|
||||
->once()
|
||||
->with('@link http://phpdoc.org/ description', $context)
|
||||
->andReturn(new Link('http://phpdoc.org/', new Description('description')))
|
||||
;
|
||||
->andReturn(new Link('http://phpdoc.org/', new Description('description')));
|
||||
|
||||
$factory = new DescriptionFactory($tagFactory);
|
||||
$description = $factory->create($contents, $context);
|
||||
@@ -99,8 +98,7 @@ class DescriptionFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
$tagFactory->shouldReceive('create')
|
||||
->once()
|
||||
->with('@link http://phpdoc.org/ This', $context)
|
||||
->andReturn(new Link('http://phpdoc.org/', new Description('This')))
|
||||
;
|
||||
->andReturn(new Link('http://phpdoc.org/', new Description('This')));
|
||||
|
||||
$factory = new DescriptionFactory($tagFactory);
|
||||
$description = $factory->create($contents, $context);
|
||||
|
||||
@@ -50,8 +50,7 @@ class StandardTagFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
->shouldReceive('create')
|
||||
->once()
|
||||
->with($expectedDescriptionText, $context)
|
||||
->andReturn($expectedDescription)
|
||||
;
|
||||
->andReturn($expectedDescription);
|
||||
|
||||
$tagFactory = new StandardTagFactory(m::mock(FqsenResolver::class));
|
||||
$tagFactory->addService($descriptionFactory, DescriptionFactory::class);
|
||||
@@ -99,8 +98,7 @@ class StandardTagFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
->shouldReceive('resolve')
|
||||
->with('Tag', m::type(Context::class))
|
||||
->andReturn(new Fqsen($fqsen))
|
||||
->getMock()
|
||||
;
|
||||
->getMock();
|
||||
$descriptionFactory = m::mock(DescriptionFactory::class);
|
||||
$descriptionFactory->shouldIgnoreMissing();
|
||||
|
||||
@@ -161,8 +159,7 @@ class StandardTagFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
[FqsenResolver::class => $resolver, 'myParam' => 'myValue'],
|
||||
'serviceLocator',
|
||||
$tagFactory
|
||||
)
|
||||
;
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -181,8 +178,7 @@ class StandardTagFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
[FqsenResolver::class => $resolver, PassthroughFormatter::class => $service],
|
||||
'serviceLocator',
|
||||
$tagFactory
|
||||
)
|
||||
;
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -202,8 +198,7 @@ class StandardTagFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
[FqsenResolver::class => $resolver, $interfaceName => $service],
|
||||
'serviceLocator',
|
||||
$tagFactory
|
||||
)
|
||||
;
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -340,8 +335,7 @@ class StandardTagFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
->shouldReceive('create')
|
||||
->once()
|
||||
->with('', $context)
|
||||
->andReturn(new Description(''))
|
||||
;
|
||||
->andReturn(new Description(''));
|
||||
|
||||
$typeResolver = new TypeResolver();
|
||||
|
||||
|
||||
@@ -342,7 +342,8 @@ class MethodTest extends \PHPUnit_Framework_TestCase
|
||||
$expectedType,
|
||||
$expectedValueType = null,
|
||||
$expectedKeyType = null
|
||||
) { $resolver = new TypeResolver();
|
||||
) {
|
||||
$resolver = new TypeResolver();
|
||||
$descriptionFactory = m::mock(DescriptionFactory::class);
|
||||
$descriptionFactory->shouldReceive('create')->with('', null)->andReturn(new Description(''));
|
||||
|
||||
@@ -540,7 +541,8 @@ class MethodTest extends \PHPUnit_Framework_TestCase
|
||||
new Compound([
|
||||
new Array_(new Object_(new Fqsen('\MyClass'))),
|
||||
new Array_(new Integer()),
|
||||
])
|
||||
, $fixture->getReturnType());
|
||||
]),
|
||||
$fixture->getReturnType()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,8 +140,12 @@ class PropertyReadTest extends \PHPUnit_Framework_TestCase
|
||||
$description = new Description('My Description');
|
||||
$descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description);
|
||||
|
||||
$fixture = PropertyRead::create('string $myProperty My Description', $typeResolver, $descriptionFactory,
|
||||
$context);
|
||||
$fixture = PropertyRead::create(
|
||||
'string $myProperty My Description',
|
||||
$typeResolver,
|
||||
$descriptionFactory,
|
||||
$context
|
||||
);
|
||||
|
||||
$this->assertSame('string $myProperty My Description', (string)$fixture);
|
||||
$this->assertSame('myProperty', $fixture->getVariableName());
|
||||
|
||||
@@ -140,8 +140,12 @@ class PropertyWriteTest extends \PHPUnit_Framework_TestCase
|
||||
$description = new Description('My Description');
|
||||
$descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description);
|
||||
|
||||
$fixture = PropertyWrite::create('string $myProperty My Description', $typeResolver, $descriptionFactory,
|
||||
$context);
|
||||
$fixture = PropertyWrite::create(
|
||||
'string $myProperty My Description',
|
||||
$typeResolver,
|
||||
$descriptionFactory,
|
||||
$context
|
||||
);
|
||||
|
||||
$this->assertSame('string $myProperty My Description', (string)$fixture);
|
||||
$this->assertSame('myProperty', $fixture->getVariableName());
|
||||
|
||||
@@ -125,8 +125,7 @@ class UsesTest extends \PHPUnit_Framework_TestCase
|
||||
$description = new Description('My Description');
|
||||
|
||||
$descriptionFactory
|
||||
->shouldReceive('create')->with('My Description', $context)->andReturn($description)
|
||||
;
|
||||
->shouldReceive('create')->with('My Description', $context)->andReturn($description);
|
||||
$resolver->shouldReceive('resolve')->with('DateTime', $context)->andReturn($fqsen);
|
||||
|
||||
$fixture = Uses::create('DateTime My Description', $resolver, $descriptionFactory, $context);
|
||||
|
||||
Reference in New Issue
Block a user