@@ -25,10 +25,10 @@ discard block |
||
25 | 25 | |
26 | 26 | public function __construct(LibraryFinderInterface $finder=null, CacheInterface $cache=null) |
27 | 27 | { |
28 | - if (is_object($finder)) |
|
29 | - { |
|
30 | - $this->finder = $finder; |
|
31 | - } |
|
28 | + if (is_object($finder)) |
|
29 | + { |
|
30 | + $this->finder = $finder; |
|
31 | + } |
|
32 | 32 | |
33 | 33 | if (is_object($cache)) |
34 | 34 | { |
@@ -166,34 +166,34 @@ discard block |
||
166 | 166 | return null; |
167 | 167 | } |
168 | 168 | |
169 | - if (is_string($params)) |
|
170 | - { |
|
171 | - if (empty($params)) |
|
172 | - { |
|
173 | - return null; |
|
174 | - } |
|
169 | + if (is_string($params)) |
|
170 | + { |
|
171 | + if (empty($params)) |
|
172 | + { |
|
173 | + return null; |
|
174 | + } |
|
175 | 175 | |
176 | - $new_params = [ ]; |
|
176 | + $new_params = [ ]; |
|
177 | 177 | |
178 | - $separator = ' '; |
|
179 | - if (strpos($params, ',') !== false) |
|
180 | - { |
|
181 | - $separator = ','; |
|
182 | - } |
|
178 | + $separator = ' '; |
|
179 | + if (strpos($params, ',') !== false) |
|
180 | + { |
|
181 | + $separator = ','; |
|
182 | + } |
|
183 | 183 | |
184 | - $params = explode($separator, $params); |
|
185 | - unset($separator); |
|
184 | + $params = explode($separator, $params); |
|
185 | + unset($separator); |
|
186 | 186 | |
187 | - foreach ($params as $p) |
|
188 | - { |
|
189 | - list($key, $val) = explode('=', $p); |
|
187 | + foreach ($params as $p) |
|
188 | + { |
|
189 | + list($key, $val) = explode('=', $p); |
|
190 | 190 | |
191 | - $new_params[ trim($key) ] = trim($val, ', '); |
|
192 | - } |
|
191 | + $new_params[ trim($key) ] = trim($val, ', '); |
|
192 | + } |
|
193 | 193 | |
194 | - $params = $new_params; |
|
195 | - unset($new_params); |
|
196 | - } |
|
194 | + $params = $new_params; |
|
195 | + unset($new_params); |
|
196 | + } |
|
197 | 197 | |
198 | 198 | if (is_array($params) && !count($params)) |
199 | 199 | { |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | //-------------------------------------------------------------------- |
25 | 25 | |
26 | - public function __construct(LibraryFinderInterface $finder=null, CacheInterface $cache=null) |
|
26 | + public function __construct(LibraryFinderInterface $finder = null, CacheInterface $cache = null) |
|
27 | 27 | { |
28 | 28 | if (is_object($finder)) |
29 | 29 | { |
@@ -50,14 +50,14 @@ discard block |
||
50 | 50 | * |
51 | 51 | * @return null|string |
52 | 52 | */ |
53 | - public function display($library, $params=null, $cache_name=null, $cache_ttl=0) |
|
53 | + public function display($library, $params = null, $cache_name = null, $cache_ttl = 0) |
|
54 | 54 | { |
55 | 55 | list($class, $method) = $this->determineClass($library); |
56 | 56 | |
57 | 57 | // Is it cached? |
58 | - $cache_name = ! empty($cache_name) ? $cache_name : $class . $method . md5(serialize($params)); |
|
58 | + $cache_name = !empty($cache_name) ? $cache_name : $class.$method.md5(serialize($params)); |
|
59 | 59 | |
60 | - if (! empty($this->cache) && $output = $this->cache->get($cache_name)) |
|
60 | + if (!empty($this->cache) && $output = $this->cache->get($cache_name)) |
|
61 | 61 | { |
62 | 62 | return $output; |
63 | 63 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | if ($this->isStaticMethod($instance, $method)) |
74 | 74 | { |
75 | - $output = $instance::{$method}( $this->prepareParams($params) ); |
|
75 | + $output = $instance::{$method}($this->prepareParams($params)); |
|
76 | 76 | } |
77 | 77 | else |
78 | 78 | { |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | } |
81 | 81 | |
82 | 82 | // Can we cache it? |
83 | - if (! empty($this->cache)) |
|
83 | + if (!empty($this->cache)) |
|
84 | 84 | { |
85 | 85 | $this->cache->set($cache_name, $output, $cache_ttl); |
86 | 86 | } |
@@ -73,8 +73,7 @@ discard block |
||
73 | 73 | if ($this->isStaticMethod($instance, $method)) |
74 | 74 | { |
75 | 75 | $output = $instance::{$method}( $this->prepareParams($params) ); |
76 | - } |
|
77 | - else |
|
76 | + } else |
|
78 | 77 | { |
79 | 78 | $output = $instance->{$method}($this->prepareParams($params)); |
80 | 79 | } |
@@ -130,8 +129,7 @@ discard block |
||
130 | 129 | $found = true; |
131 | 130 | } |
132 | 131 | } |
133 | - } |
|
134 | - else |
|
132 | + } else |
|
135 | 133 | { |
136 | 134 | $found = true; |
137 | 135 | } |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | public function __construct() |
10 | 10 | { |
11 | - $this->ci =& get_instance(); |
|
11 | + $this->ci = & get_instance(); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | //-------------------------------------------------------------------- |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | public function get($key) |
28 | 28 | { |
29 | 29 | // Does CI even have a cache engine loaded? |
30 | - if (! is_object($this->ci->cache)) |
|
30 | + if (!is_object($this->ci->cache)) |
|
31 | 31 | { |
32 | 32 | return false; |
33 | 33 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | public function set($key, $content, $ttl) |
49 | 49 | { |
50 | 50 | // Does CI even have a cache engine loaded? |
51 | - if (! is_object($this->ci->cache)) |
|
51 | + if (!is_object($this->ci->cache)) |
|
52 | 52 | { |
53 | 53 | return true; |
54 | 54 | } |
@@ -14,7 +14,7 @@ |
||
14 | 14 | */ |
15 | 15 | public function find($class) |
16 | 16 | { |
17 | - $ci =& get_instance(); |
|
17 | + $ci =& get_instance(); |
|
18 | 18 | |
19 | 19 | $ci->load->library($class); |
20 | 20 |
@@ -14,7 +14,7 @@ |
||
14 | 14 | */ |
15 | 15 | public function find($class) |
16 | 16 | { |
17 | - $ci =& get_instance(); |
|
17 | + $ci = & get_instance(); |
|
18 | 18 | |
19 | 19 | $ci->load->library($class); |
20 | 20 |