@@ -25,9 +25,9 @@ discard block |
||
| 25 | 25 | * @param array $model |
| 26 | 26 | * @param string $template_path |
| 27 | 27 | */ |
| 28 | - public function __construct( array $model = array(), $template_path = null ) |
|
| 28 | + public function __construct(array $model = array(), $template_path = null) |
|
| 29 | 29 | { |
| 30 | - $this->set_model( $model ); |
|
| 30 | + $this->set_model($model); |
|
| 31 | 31 | $this->template = $template_path; |
| 32 | 32 | } |
| 33 | 33 | |
@@ -38,9 +38,9 @@ discard block |
||
| 38 | 38 | * |
| 39 | 39 | * @return mixed the argument's value. |
| 40 | 40 | */ |
| 41 | - public function __get( $name ) |
|
| 41 | + public function __get($name) |
|
| 42 | 42 | { |
| 43 | - if( isset( $this->model[$name] ) ) |
|
| 43 | + if (isset($this->model[$name])) |
|
| 44 | 44 | { |
| 45 | 45 | return $this->model[$name]; |
| 46 | 46 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | * |
| 55 | 55 | * @return mixed the settings' argument value. |
| 56 | 56 | */ |
| 57 | - public function __set( $name, $value ) |
|
| 57 | + public function __set($name, $value) |
|
| 58 | 58 | { |
| 59 | 59 | $this->model[$name] = $value; |
| 60 | 60 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | * @param string $name The argument's name. |
| 66 | 66 | * @return boolean Whether this arguments exists or not. |
| 67 | 67 | */ |
| 68 | - public function __isset( $name ) |
|
| 68 | + public function __isset($name) |
|
| 69 | 69 | { |
| 70 | 70 | return isset($this->model[$name]); |
| 71 | 71 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | * |
| 86 | 86 | * @return array |
| 87 | 87 | */ |
| 88 | - public function set_model( $model ) |
|
| 88 | + public function set_model($model) |
|
| 89 | 89 | { |
| 90 | 90 | $this->model = $model; |
| 91 | 91 | } |
@@ -106,22 +106,22 @@ discard block |
||
| 106 | 106 | * @return string The rendered template. |
| 107 | 107 | * @throws TemplateNotFoundException Thrown if the template file cannot be found. |
| 108 | 108 | */ |
| 109 | - public function render( $echo = false ) |
|
| 109 | + public function render($echo = false) |
|
| 110 | 110 | { |
| 111 | 111 | $rendered_html = ''; |
| 112 | 112 | |
| 113 | - if( file_exists( $this->get_template_path() ) ) |
|
| 113 | + if (file_exists($this->get_template_path())) |
|
| 114 | 114 | { |
| 115 | 115 | ob_start(); |
| 116 | - include( $this->get_template_path() ); |
|
| 116 | + include($this->get_template_path()); |
|
| 117 | 117 | $rendered_html = ob_get_clean(); |
| 118 | 118 | } |
| 119 | 119 | else |
| 120 | 120 | { |
| 121 | - throw new \RuntimeException( "Error: cannot render HTML, template file not found at " . $this->get_template_path() ); |
|
| 121 | + throw new \RuntimeException("Error: cannot render HTML, template file not found at ".$this->get_template_path()); |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - if( !$echo ) |
|
| 124 | + if (!$echo) |
|
| 125 | 125 | { |
| 126 | 126 | return $rendered_html; |
| 127 | 127 | } |