@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | * @param bool $static |
| 34 | 34 | * @return bool |
| 35 | 35 | */ |
| 36 | - protected function checkMacroConditions($static=false) |
|
| 36 | + protected function checkMacroConditions($static = false) |
|
| 37 | 37 | {
|
| 38 | 38 | return is_string($this->macro) && |
| 39 | 39 | Utils::isNamespaceExists($this->macro) && |
@@ -46,9 +46,9 @@ discard block |
||
| 46 | 46 | * @param bool $static |
| 47 | 47 | * @return bool |
| 48 | 48 | */ |
| 49 | - protected function checkMacroInstanceOf($static=false) |
|
| 49 | + protected function checkMacroInstanceOf($static = false) |
|
| 50 | 50 | {
|
| 51 | - if($static){
|
|
| 51 | + if ($static) {
|
|
| 52 | 52 | return true; |
| 53 | 53 | } |
| 54 | 54 | return $this->app->resolve($this->macro) instanceof MacroAbleContracts; |
@@ -61,15 +61,15 @@ discard block |
||
| 61 | 61 | * @param callable $callback |
| 62 | 62 | * @return mixed |
| 63 | 63 | */ |
| 64 | - public function get($method,callable $callback) |
|
| 64 | + public function get($method, callable $callback) |
|
| 65 | 65 | {
|
| 66 | - if($this->isMacro){
|
|
| 66 | + if ($this->isMacro) {
|
|
| 67 | 67 | |
| 68 | - if(is_null($method) && Utils::isNamespaceExists($this->macro)){
|
|
| 68 | + if (is_null($method) && Utils::isNamespaceExists($this->macro)) {
|
|
| 69 | 69 | return $this->app->resolve($this->macro)($this->getValues()); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - if(method_exists($resolve = $this->app->resolve($this->macro),$method)){
|
|
| 72 | + if (method_exists($resolve = $this->app->resolve($this->macro), $method)) {
|
|
| 73 | 73 | return $resolve->macro($this->class); |
| 74 | 74 | } |
| 75 | 75 | } |
@@ -93,11 +93,11 @@ discard block |
||
| 93 | 93 | * @param $class |
| 94 | 94 | * @return $this |
| 95 | 95 | */ |
| 96 | - public function isMacro($class,$static=false) |
|
| 96 | + public function isMacro($class, $static = false) |
|
| 97 | 97 | {
|
| 98 | 98 | // if the macro class is a valid object, |
| 99 | 99 | // then this macro will return a boolean value if it has the specified methode. |
| 100 | - if($this->checkMacroConditions($static)){
|
|
| 100 | + if ($this->checkMacroConditions($static)) {
|
|
| 101 | 101 | |
| 102 | 102 | $this->isMacro = true; |
| 103 | 103 | $this->class = $class; |
@@ -125,10 +125,10 @@ discard block |
||
| 125 | 125 | * @param $method |
| 126 | 126 | * @return mixed |
| 127 | 127 | */ |
| 128 | - public function with($macro,$concrete,$method=null) |
|
| 128 | + public function with($macro, $concrete, $method = null) |
|
| 129 | 129 | {
|
| 130 | - if($this->macro === null){
|
|
| 131 | - return $this($macro)->isMacro($concrete)->get($method,function() use($concrete){
|
|
| 130 | + if ($this->macro===null) {
|
|
| 131 | + return $this($macro)->isMacro($concrete)->get($method, function() use($concrete){
|
|
| 132 | 132 | return $concrete; |
| 133 | 133 | }); |
| 134 | 134 | } |
@@ -142,9 +142,9 @@ discard block |
||
| 142 | 142 | * @param $method |
| 143 | 143 | * @return mixed |
| 144 | 144 | */ |
| 145 | - public function withStatic($macro,$concrete) |
|
| 145 | + public function withStatic($macro, $concrete) |
|
| 146 | 146 | {
|
| 147 | - return $this($macro)->isMacro($concrete,true)->get(null,is_callable($concrete) ? |
|
| 147 | + return $this($macro)->isMacro($concrete, true)->get(null, is_callable($concrete) ? |
|
| 148 | 148 | $concrete : function() use($concrete){
|
| 149 | 149 | return $concrete; |
| 150 | 150 | }); |
@@ -156,9 +156,9 @@ discard block |
||
| 156 | 156 | * @param null|string $macro |
| 157 | 157 | * @return $this |
| 158 | 158 | */ |
| 159 | - public function __invoke($macro=null) |
|
| 159 | + public function __invoke($macro = null) |
|
| 160 | 160 | {
|
| 161 | - if($macro!==null){
|
|
| 161 | + if ($macro!==null) {
|
|
| 162 | 162 | $this->macro = $macro; |
| 163 | 163 | } |
| 164 | 164 | return $this; |