Skip to content
This repository was archived by the owner on Feb 6, 2020. It is now read-only.

Commit 6a231ee

Browse files
asgrimXerkus
authored andcommitted
Update annotations and comments for consistency
1 parent ff2ce4d commit 6a231ee

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

src/AbstractFactory/ReflectionBasedAbstractFactory.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @link http://github.com/zendframework/zend-servicemanager for the canonical source repository
4-
* @copyright Copyright (c) 2018 Zend Technologies USA Inc. (http://www.zend.com)
4+
* @copyright Copyright (c) 2016-2018 Zend Technologies USA Inc. (http://www.zend.com)
55
* @license http://framework.zend.com/license/new-bsd New BSD License
66
*/
77

@@ -131,18 +131,12 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o
131131

132132
/**
133133
* {@inheritDoc}
134-
* @throws \ReflectionException
135134
*/
136135
public function canCreate(ContainerInterface $container, $requestedName)
137136
{
138137
return class_exists($requestedName) && $this->canCallConstructor($requestedName);
139138
}
140139

141-
/**
142-
* @param string $requestedName
143-
* @return bool
144-
* @throws \ReflectionException
145-
*/
146140
private function canCallConstructor(string $requestedName) : bool
147141
{
148142
$constructor = (new ReflectionClass($requestedName))->getConstructor();

test/AbstractFactory/ReflectionBasedAbstractFactoryTest.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @link http://github.com/zendframework/zend-servicemanager for the canonical source repository
4-
* @copyright Copyright (c) 2018 Zend Technologies USA Inc. (http://www.zend.com)
4+
* @copyright Copyright (c) 2016-2018 Zend Technologies USA Inc. (http://www.zend.com)
55
* @license http://framework.zend.com/license/new-bsd New BSD License
66
*/
77

@@ -10,11 +10,13 @@
1010
use ArrayAccess;
1111
use Interop\Container\ContainerInterface;
1212
use PHPUnit\Framework\TestCase;
13+
use Prophecy\Prophecy\ObjectProphecy;
1314
use Zend\ServiceManager\AbstractFactory\ReflectionBasedAbstractFactory;
1415
use Zend\ServiceManager\Exception\ServiceNotFoundException;
1516

1617
class ReflectionBasedAbstractFactoryTest extends TestCase
1718
{
19+
/** @var ContainerInterface|ObjectProphecy */
1820
private $container;
1921

2022
public function setUp()
@@ -38,10 +40,7 @@ public function testCanCreateReturnsFalseForNonClassRequestedNames($requestedNam
3840
$this->assertFalse($factory->canCreate($this->container->reveal(), $requestedName));
3941
}
4042

41-
/**
42-
* @throws \ReflectionException
43-
*/
44-
public function testCanCreateReturnsFalseWhenConstructorIsPrivate() : void
43+
public function testCanCreateReturnsFalseWhenConstructorIsPrivate()
4544
{
4645
self::assertFalse(
4746
(new ReflectionBasedAbstractFactory())->canCreate(

0 commit comments

Comments
 (0)