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

Commit

Permalink
Update annotations and comments for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
asgrim committed May 8, 2018
1 parent f09bc8e commit 9e33889
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
8 changes: 1 addition & 7 deletions src/AbstractFactory/ReflectionBasedAbstractFactory.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @link http://github.com/zendframework/zend-servicemanager for the canonical source repository
* @copyright Copyright (c) 2018 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2016-2018 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand Down Expand Up @@ -135,18 +135,12 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o

/**
* {@inheritDoc}
* @throws \ReflectionException
*/
public function canCreate(ContainerInterface $container, $requestedName)
{
return class_exists($requestedName) && $this->canCallConstructor($requestedName);
}

/**
* @param string $requestedName
* @return bool
* @throws \ReflectionException
*/
private function canCallConstructor(string $requestedName) : bool
{
$constructor = (new ReflectionClass($requestedName))->getConstructor();
Expand Down
7 changes: 3 additions & 4 deletions test/AbstractFactory/ReflectionBasedAbstractFactoryTest.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<?php
/**
* @link http://github.com/zendframework/zend-servicemanager for the canonical source repository
* @copyright Copyright (c) 2018 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2016-2018 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace ZendTest\ServiceManager\AbstractFactory;

use ArrayAccess;
use PHPUnit\Framework\TestCase;
use Prophecy\Prophecy\ObjectProphecy;
use Psr\Container\ContainerInterface;
use Zend\ServiceManager\AbstractFactory\ReflectionBasedAbstractFactory;
use Zend\ServiceManager\Exception\ServiceNotFoundException;
Expand All @@ -17,6 +18,7 @@

class ReflectionBasedAbstractFactoryTest extends TestCase
{
/** @var ContainerInterface|ObjectProphecy */
private $container;

public function setUp()
Expand All @@ -40,9 +42,6 @@ public function testCanCreateReturnsFalseForNonClassRequestedNames($requestedNam
self::assertFalse($factory->canCreate($this->container->reveal(), $requestedName));
}

/**
* @throws \ReflectionException
*/
public function testCanCreateReturnsFalseWhenConstructorIsPrivate() : void
{
self::assertFalse(
Expand Down

0 comments on commit 9e33889

Please sign in to comment.