File tree 4 files changed +36
-34
lines changed
4 files changed +36
-34
lines changed Original file line number Diff line number Diff line change @@ -8,5 +8,4 @@ thumbs.db
8
8
.settings
9
9
.idea
10
10
composer.lock
11
- composer.phar
12
- vendor /*
11
+ vendor /*
Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " frostealth/php-container" ,
3
- "description" : " PHP Container" ,
4
- "keywords" : [" di" , " container" ],
5
- "license" : " MIT" ,
6
- "authors" : [
7
- {
8
- "name" : " Kudinov Ivan" ,
9
- "email" : " frostealth@gmail.com" ,
10
- "role" : " Developer"
11
- }
12
- ],
13
- "autoload" : {
14
- "psr-4" : {
15
- "frostealth\\ " : " src/"
16
- }
17
- },
18
- "require" : {
19
- "php" : " >=5.4.0" ,
20
- "frostealth/php-data-storage" : " 1.0.*"
21
- },
22
- "autoload-dev" : {
23
- "psr-4" : {
24
- "frostealth\\ Container\\ tests\\ " : " tests/"
25
- }
26
- },
27
- "require-dev" : {
28
- "phpunit/phpunit" : " 4.2.*"
2
+ "name" : " frostealth/php-container" ,
3
+ "description" : " PHP Container" ,
4
+ "keywords" : [
5
+ " di" ,
6
+ " container"
7
+ ],
8
+ "license" : " MIT" ,
9
+ "authors" : [
10
+ {
11
+ "name" : " Ivan Kudinov" ,
12
+ "email" : " frostealth@gmail.com" ,
13
+ "homepage" : " http://frostealth.ru"
29
14
}
15
+ ],
16
+ "autoload" : {
17
+ "psr-4" : {
18
+ "frostealth\\ " : " src/"
19
+ }
20
+ },
21
+ "require" : {
22
+ "php" : " >=5.4.0" ,
23
+ "frostealth/php-data-storage" : " 1.0.*"
24
+ },
25
+ "autoload-dev" : {
26
+ "psr-4" : {
27
+ "frostealth\\ Tests\\ Container\\ " : " tests/"
28
+ }
29
+ },
30
+ "require-dev" : {
31
+ "phpunit/phpunit" : " 4.2.*"
32
+ }
30
33
}
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ public function get($name)
28
28
{
29
29
$ value = $ this ->storage ->get ($ name );
30
30
if (is_callable ($ value )) {
31
- $ value = $ value( $ this );
31
+ $ value = call_user_func ( $ value, $ this );
32
32
}
33
33
34
34
return $ value ;
@@ -65,13 +65,13 @@ public function remove($name)
65
65
* @param string $name
66
66
* @param callable $callable
67
67
*/
68
- public function singleton ($ name , \ Closure $ callable )
68
+ public function singleton ($ name , callable $ callable )
69
69
{
70
70
$ this ->storage ->set ($ name , function () use ($ callable ) {
71
71
static $ instance = null ;
72
72
73
73
if ($ instance === null ) {
74
- $ instance = $ callable( $ this );
74
+ $ instance = call_user_func ( $ callable, $ this );
75
75
}
76
76
77
77
return $ instance ;
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
- namespace frostealth \Container \ tests ;
3
+ namespace frostealth \Tests \ Container ;
4
4
5
5
use frostealth \Container \Container ;
6
6
7
7
/**
8
8
* Class ContainerTest
9
9
*
10
- * @package frostealth\ContainerTest\tests
10
+ * @package frostealth\Tests\Container
11
11
*/
12
12
class ContainerTest extends \PHPUnit_Framework_TestCase
13
13
{
You can’t perform that action at this time.
0 commit comments