| @@ 32-39 (lines=8) @@ | ||
| 29 | * @param array $vars |
|
| 30 | * @return Renderer |
|
| 31 | */ |
|
| 32 | public function create($baseDir = null, array $vars = []) { |
|
| 33 | if($baseDir === null) { |
|
| 34 | $baseDir = $this->baseDir; |
|
| 35 | } elseif($this->baseDir !== null) { |
|
| 36 | $baseDir = Directories::concat($this->baseDir, $baseDir); |
|
| 37 | } |
|
| 38 | return call_user_func($this->callback, $baseDir, $vars); |
|
| 39 | } |
|
| 40 | ||
| 41 | /** |
|
| 42 | * @param string $baseDir |
|
| @@ 46-53 (lines=8) @@ | ||
| 43 | * @param array $vars |
|
| 44 | * @return $this |
|
| 45 | */ |
|
| 46 | public function deriveFactory($baseDir = null, array $vars = []) { |
|
| 47 | if($baseDir === null) { |
|
| 48 | $baseDir = $this->baseDir; |
|
| 49 | } elseif($this->baseDir !== null) { |
|
| 50 | $baseDir = Directories::concat($this->baseDir, $baseDir); |
|
| 51 | } |
|
| 52 | return new static($this->callback, $baseDir, array_merge($this->vars, $vars)); |
|
| 53 | } |
|
| 54 | } |
|
| 55 | ||