@@ -58,6 +58,9 @@ |
||
58 | 58 | protected $pattern = ""; |
59 | 59 | protected $callable; |
60 | 60 | |
61 | + /** |
|
62 | + * @param string $pattern |
|
63 | + */ |
|
61 | 64 | public function __construct($pattern, $callable) { |
62 | 65 | $this->setPattern($pattern); |
63 | 66 | $this->setCallable($callable); |
@@ -48,10 +48,12 @@ |
||
48 | 48 | */ |
49 | 49 | public function __construct($config = []) { |
50 | 50 | set_exception_handler([$this, "exceptionHandler"]); |
51 | - if (is_array($config)) |
|
52 | - $config = new \Tight\TightConfig($config); |
|
53 | - if (!$config instanceof \Tight\TightConfig) |
|
54 | - throw new \InvalidArgumentException("Argument passed to Tight::__constructor must be array or <b>\Tight\TightConfig</b> object"); |
|
51 | + if (is_array($config)) { |
|
52 | + $config = new \Tight\TightConfig($config); |
|
53 | + } |
|
54 | + if (!$config instanceof \Tight\TightConfig) { |
|
55 | + throw new \InvalidArgumentException("Argument passed to Tight::__constructor must be array or <b>\Tight\TightConfig</b> object"); |
|
56 | + } |
|
55 | 57 | $this->config = $config; |
56 | 58 | $this->router = new Router($config->basePath); |
57 | 59 | } |
@@ -44,10 +44,11 @@ |
||
44 | 44 | } |
45 | 45 | } |
46 | 46 | public function __get($name) { |
47 | - if(isset($this->config[$name])) |
|
48 | - return $this->config[$name]; |
|
49 | - else |
|
50 | - return null; |
|
47 | + if(isset($this->config[$name])) { |
|
48 | + return $this->config[$name]; |
|
49 | + } else { |
|
50 | + return null; |
|
51 | + } |
|
51 | 52 | } |
52 | 53 | public function __set($name, $value) { |
53 | 54 | $this->config[$name] = $value; |