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

Commit c9df6a3

Browse files
committed
Incorporate feedback from review
- Use private visibility for `$container` property - Remove `setContainer()` method; updated tests to create a new `ConfigDumper` instance using the mock container, instead of using setter injection. - Updated copyrights on licence docblocks of changed files.
1 parent d8c70fc commit c9df6a3

File tree

5 files changed

+17
-20
lines changed

5 files changed

+17
-20
lines changed

src/Tool/ConfigDumper.php

Lines changed: 2 additions & 10 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) 2016 Zend Technologies USA Inc. (http://www.zend.com)
4+
* @copyright Copyright (c) 2016-2017 Zend Technologies USA Inc. (http://www.zend.com)
55
* @license http://framework.zend.com/license/new-bsd New BSD License
66
*/
77

@@ -29,7 +29,7 @@ class ConfigDumper
2929
/**
3030
* @var ContainerInterface
3131
*/
32-
protected $container;
32+
private $container;
3333

3434
/**
3535
* @param ContainerInterface $container
@@ -39,14 +39,6 @@ public function __construct(ContainerInterface $container = null)
3939
$this->container = $container;
4040
}
4141

42-
/**
43-
* @param ContainerInterface $container
44-
*/
45-
public function setContainer(ContainerInterface $container)
46-
{
47-
$this->container = $container;
48-
}
49-
5042
/**
5143
* @param array $config
5244
* @param string $className

src/Tool/ConfigDumperCommand.php

Lines changed: 1 addition & 1 deletion
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) 2016 Zend Technologies USA Inc. (http://www.zend.com)
4+
* @copyright Copyright (c) 2016-2017 Zend Technologies USA Inc. (http://www.zend.com)
55
* @license http://framework.zend.com/license/new-bsd New BSD License
66
*/
77

test/TestAsset/ObjectWithObjectScalarDependency.php

Lines changed: 1 addition & 1 deletion
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) 2016 Zend Technologies USA Inc. (http://www.zend.com)
4+
* @copyright Copyright (c) 2017 Zend Technologies USA Inc. (http://www.zend.com)
55
* @license http://framework.zend.com/license/new-bsd New BSD License
66
*/
77

test/Tool/ConfigDumperCommandTest.php

Lines changed: 3 additions & 3 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) 2016 Zend Technologies USA Inc. (http://www.zend.com)
4+
* @copyright Copyright (c) 2016-2017 Zend Technologies USA Inc. (http://www.zend.com)
55
* @license http://framework.zend.com/license/new-bsd New BSD License
66
*/
77

@@ -63,8 +63,8 @@ public function helpArguments()
6363
public function ignoreUnresolvedArguments()
6464
{
6565
return [
66-
'short' => ['-i'],
67-
'long' => ['--ignore-unresolved'],
66+
'short' => ['-i'],
67+
'long' => ['--ignore-unresolved'],
6868
];
6969
}
7070

test/Tool/ConfigDumperTest.php

Lines changed: 10 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) 2016 Zend Technologies USA Inc. (http://www.zend.com)
4+
* @copyright Copyright (c) 2016-2017 Zend Technologies USA Inc. (http://www.zend.com)
55
* @license http://framework.zend.com/license/new-bsd New BSD License
66
*/
77

@@ -114,8 +114,10 @@ public function testCreateDependencyConfigWithContainerAndNoServiceWithoutTypeHi
114114
$container->has(ObjectWithScalarDependency::class)
115115
->shouldBeCalled()
116116
->willReturn(false);
117-
$this->dumper->setContainer($container->reveal());
118-
$config = $this->dumper->createDependencyConfig(
117+
118+
$dumper = new ConfigDumper($container->reveal());
119+
120+
$config = $dumper->createDependencyConfig(
119121
[ConfigAbstractFactory::class => []],
120122
ObjectWithScalarDependency::class
121123
);
@@ -127,11 +129,14 @@ public function testCreateDependencyConfigWithContainerWithoutTypeHintedParamete
127129
$container->has(ObjectWithScalarDependency::class)
128130
->shouldBeCalled()
129131
->willReturn(true);
130-
$this->dumper->setContainer($container->reveal());
131-
$config = $this->dumper->createDependencyConfig(
132+
133+
$dumper = new ConfigDumper($container->reveal());
134+
135+
$config = $dumper->createDependencyConfig(
132136
[ConfigAbstractFactory::class => []],
133137
ObjectWithObjectScalarDependency::class
134138
);
139+
135140
self::assertEquals(
136141
[
137142
ConfigAbstractFactory::class => [

0 commit comments

Comments
 (0)