@@ -22,10 +22,10 @@ discard block |
||
| 22 | 22 | * @throws \DI\DependencyException |
| 23 | 23 | * @throws \DI\NotFoundException |
| 24 | 24 | */ |
| 25 | - public static function resolve($class=null) |
|
| 25 | + public static function resolve($class = null) |
|
| 26 | 26 | {
|
| 27 | 27 | //class resolve |
| 28 | - if(!is_null($class)){
|
|
| 28 | + if (!is_null($class)) {
|
|
| 29 | 29 | $container = self::callBuild(); |
| 30 | 30 | return $container->get($class); |
| 31 | 31 | } |
@@ -41,12 +41,12 @@ discard block |
||
| 41 | 41 | * @throws \DI\DependencyException |
| 42 | 42 | * @throws \DI\NotFoundException |
| 43 | 43 | */ |
| 44 | - public static function make($class=null, $param=array()) |
|
| 44 | + public static function make($class = null, $param = array()) |
|
| 45 | 45 | {
|
| 46 | - if($class!==null){
|
|
| 46 | + if ($class!==null) {
|
|
| 47 | 47 | |
| 48 | 48 | $container = self::callBuild(); |
| 49 | - return $container->make($class,$param); |
|
| 49 | + return $container->make($class, $param); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | return null; |
@@ -58,9 +58,9 @@ discard block |
||
| 58 | 58 | * |
| 59 | 59 | * @throws \DI\DependencyException |
| 60 | 60 | */ |
| 61 | - public static function injectOnBind($class=null) |
|
| 61 | + public static function injectOnBind($class = null) |
|
| 62 | 62 | {
|
| 63 | - if($class!==null){
|
|
| 63 | + if ($class!==null) {
|
|
| 64 | 64 | |
| 65 | 65 | $container = self::callBuild(); |
| 66 | 66 | return $container->injectOn($class); |
@@ -74,10 +74,10 @@ discard block |
||
| 74 | 74 | * @param array $param |
| 75 | 75 | * @return mixed |
| 76 | 76 | */ |
| 77 | - public static function callBind($class=null, $param=array()) |
|
| 77 | + public static function callBind($class = null, $param = array()) |
|
| 78 | 78 | {
|
| 79 | - return (app()->resolve(ContainerResolve::class))->call($class,$param,function($call){
|
|
| 80 | - return self::callBuild()->call($call->class,$call->param); |
|
| 79 | + return (app()->resolve(ContainerResolve::class))->call($class, $param, function($call) {
|
|
| 80 | + return self::callBuild()->call($call->class, $call->param); |
|
| 81 | 81 | }); |
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | \ No newline at end of file |