This repository was archived by the owner on Jan 29, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +91
-1
lines changed Expand file tree Collapse file tree 4 files changed +91
-1
lines changed Original file line number Diff line number Diff line change 1
1
/**
2
2
* @see https://github.com/zendframework/zend-config-aggregator for the canonical source repository
3
- * @copyright Copyright (c) %regexp:(20\d{2}-)?%%year % Zend Technologies USA Inc. (http://www.zend.com)
3
+ * @copyright Copyright (c) %regexp:(20\d{2}-)?20\d{2} % Zend Technologies USA Inc. (http://www.zend.com)
4
4
* @copyright Copyright (c) 2015-2016 Mateusz Tymek (http://mateusztymek.pl)
5
5
* @license https://github.com/zendframework/zend-config-aggregator/blob/master/LICENSE.md New BSD License
6
6
*/
Original file line number Diff line number Diff line change 2
2
3
3
All notable changes to this project will be documented in this file, in reverse chronological order by release.
4
4
5
+ ## 0.2.0 - 2017-01-11
6
+
7
+ ### Added
8
+
9
+ - [ #2 ] ( https://github.com/zendframework/zend-config-aggregator/pull/2 ) adds a
10
+ new ` ArrayProvider ` , which accepts an array to its constructor, and returns
11
+ it when invoked. This can be used to provide in-line array configuration when
12
+ feeding the ` ConfigAggregator ` instance.
13
+
14
+ ### Deprecated
15
+
16
+ - Nothing.
17
+
18
+ ### Removed
19
+
20
+ - Nothing.
21
+
22
+ ### Fixed
23
+
24
+ - Nothing.
25
+
5
26
## 0.1.0 - 2016-12-08
6
27
7
28
Initial release.
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * @see https://github.com/zendframework/zend-config-aggregator for the canonical source repository
4
+ * @copyright Copyright (c) 2017 Zend Technologies USA Inc. (http://www.zend.com)
5
+ * @copyright Copyright (c) 2015-2016 Mateusz Tymek (http://mateusztymek.pl)
6
+ * @license https://github.com/zendframework/zend-config-aggregator/blob/master/LICENSE.md New BSD License
7
+ */
8
+
9
+ namespace Zend \ConfigAggregator ;
10
+
11
+ /**
12
+ * Provider that returns the array seeded to itself.
13
+ *
14
+ * Primary use case is configuration cache-related settings.
15
+ */
16
+ class ArrayProvider
17
+ {
18
+ /**
19
+ * @var array
20
+ */
21
+ private $ config ;
22
+
23
+ /**
24
+ * @param array $config
25
+ */
26
+ public function __construct (array $ config )
27
+ {
28
+ $ this ->config = $ config ;
29
+ }
30
+
31
+ /**
32
+ * @return array
33
+ */
34
+ public function __invoke ()
35
+ {
36
+ return $ this ->config ;
37
+ }
38
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * @see https://github.com/zendframework/zend-config-aggregator for the canonical source repository
4
+ * @copyright Copyright (c) 2017 Zend Technologies USA Inc. (http://www.zend.com)
5
+ * @copyright Copyright (c) 2015-2016 Mateusz Tymek (http://mateusztymek.pl)
6
+ * @license https://github.com/zendframework/zend-config-aggregator/blob/master/LICENSE.md New BSD License
7
+ */
8
+
9
+ namespace ZendTest \ConfigAggregator ;
10
+
11
+ use PHPUnit_Framework_TestCase as TestCase ;
12
+ use Zend \ConfigAggregator \ArrayProvider ;
13
+
14
+ class ArrayProviderTest extends TestCase
15
+ {
16
+ public function testProviderIsCallable ()
17
+ {
18
+ $ provider = new ArrayProvider ([]);
19
+ $ this ->assertInternalType ('callable ' , $ provider );
20
+ }
21
+
22
+ public function testProviderReturnsArrayProvidedAtConstruction ()
23
+ {
24
+ $ expected = [
25
+ 'foo ' => 'bar ' ,
26
+ ];
27
+ $ provider = new ArrayProvider ($ expected );
28
+
29
+ $ this ->assertSame ($ expected , $ provider ());
30
+ }
31
+ }
You can’t perform that action at this time.
0 commit comments