@@ -65,8 +65,7 @@ discard block |
||
| 65 | 65 | for ($chr = 0; $chr < $encodedLength; $chr++) { |
| 66 | 66 | $decoded .= ( |
| 67 | 67 | $encoded[$chr] == '=' ? |
| 68 | - chr((ord($encoded[$chr]) - 42) % 256) : |
|
| 69 | - chr((((ord($encoded[++$chr]) - 64) % 256) - 42) % 256) |
|
| 68 | + chr((ord($encoded[$chr]) - 42) % 256) : chr((((ord($encoded[++$chr]) - 64) % 256) - 42) % 256) |
|
| 70 | 69 | ); |
| 71 | 70 | } |
| 72 | 71 | |
@@ -129,8 +128,7 @@ discard block |
||
| 129 | 128 | for ($chr = 0; $chr < $length; $chr++) { |
| 130 | 129 | $text .= ( |
| 131 | 130 | $input[$chr] == '=' ? |
| 132 | - chr((((ord($input[++$chr]) - 64) % 256) - 42) % 256) : |
|
| 133 | - chr((ord($input[$chr]) - 42) % 256) |
|
| 131 | + chr((((ord($input[++$chr]) - 64) % 256) - 42) % 256) : chr((ord($input[$chr]) - 42) % 256) |
|
| 134 | 132 | ); |
| 135 | 133 | } |
| 136 | 134 | } |
@@ -236,7 +236,7 @@ |
||
| 236 | 236 | parent::_init(); |
| 237 | 237 | |
| 238 | 238 | if ($this->_config['git'] instanceof Git) { |
| 239 | - $this->git =& $this->_config['git']; |
|
| 239 | + $this->git = & $this->_config['git']; |
|
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | if (file_exists(self::UPDATES_FILE)) { |
@@ -8,17 +8,21 @@ |
||
| 8 | 8 | |
| 9 | 9 | namespace app\controllers; |
| 10 | 10 | |
| 11 | -class HelloWorldController extends \lithium\action\Controller { |
|
| 11 | +class HelloWorldController extends \lithium\action\Controller |
|
| 12 | +{ |
|
| 12 | 13 | |
| 13 | - public function index() { |
|
| 14 | + public function index() |
|
| 15 | + { |
|
| 14 | 16 | return $this->render(array('layout' => false)); |
| 15 | 17 | } |
| 16 | 18 | |
| 17 | - public function to_string() { |
|
| 19 | + public function to_string() |
|
| 20 | + { |
|
| 18 | 21 | return "Hello World"; |
| 19 | 22 | } |
| 20 | 23 | |
| 21 | - public function to_json() { |
|
| 24 | + public function to_json() |
|
| 25 | + { |
|
| 22 | 26 | return $this->render(array('json' => 'Hello World')); |
| 23 | 27 | } |
| 24 | 28 | } |
@@ -23,9 +23,11 @@ |
||
| 23 | 23 | * For example, browsing to `/pages/about/company` will render |
| 24 | 24 | * `/views/pages/about/company.html.php`. |
| 25 | 25 | */ |
| 26 | -class PagesController extends \lithium\action\Controller { |
|
| 26 | +class PagesController extends \lithium\action\Controller |
|
| 27 | +{ |
|
| 27 | 28 | |
| 28 | - public function view() { |
|
| 29 | + public function view() |
|
| 30 | + { |
|
| 29 | 31 | $options = array(); |
| 30 | 32 | $path = func_get_args(); |
| 31 | 33 | |
@@ -22,19 +22,23 @@ discard block |
||
| 22 | 22 | use app\models\Settings; |
| 23 | 23 | use lithium\action\DispatchException; |
| 24 | 24 | |
| 25 | -class SettingsController extends \lithium\action\Controller { |
|
| 25 | +class SettingsController extends \lithium\action\Controller |
|
| 26 | +{ |
|
| 26 | 27 | |
| 27 | - public function index() { |
|
| 28 | + public function index() |
|
| 29 | + { |
|
| 28 | 30 | $settings = Settings::all(); |
| 29 | 31 | return compact('settings'); |
| 30 | 32 | } |
| 31 | 33 | |
| 32 | - public function view() { |
|
| 34 | + public function view() |
|
| 35 | + { |
|
| 33 | 36 | $setting = Settings::first($this->request->id); |
| 34 | 37 | return compact('setting'); |
| 35 | 38 | } |
| 36 | 39 | |
| 37 | - public function add() { |
|
| 40 | + public function add() |
|
| 41 | + { |
|
| 38 | 42 | $setting = Settings::create(); |
| 39 | 43 | |
| 40 | 44 | if (($this->request->data) && $setting->save($this->request->data)) { |
@@ -43,7 +47,8 @@ discard block |
||
| 43 | 47 | return compact('setting'); |
| 44 | 48 | } |
| 45 | 49 | |
| 46 | - public function edit() { |
|
| 50 | + public function edit() |
|
| 51 | + { |
|
| 47 | 52 | $setting = Settings::find($this->request->id); |
| 48 | 53 | |
| 49 | 54 | if (!$setting) { |
@@ -55,7 +60,8 @@ discard block |
||
| 55 | 60 | return compact('setting'); |
| 56 | 61 | } |
| 57 | 62 | |
| 58 | - public function delete() { |
|
| 63 | + public function delete() |
|
| 64 | + { |
|
| 59 | 65 | if (!$this->request->is('post') && !$this->request->is('delete')) { |
| 60 | 66 | $msg = "Settings::delete can only be called with http:post or http:delete."; |
| 61 | 67 | throw new DispatchException($msg); |
@@ -92,7 +92,7 @@ |
||
| 92 | 92 | |
| 93 | 93 | if (isset($adapter)) { |
| 94 | 94 | if (empty(DB_SOCKET)) { |
| 95 | - $host = empty(DB_PORT) ? DB_HOST : DB_HOST.':'.DB_PORT; |
|
| 95 | + $host = empty(DB_PORT) ? DB_HOST : DB_HOST . ':' . DB_PORT; |
|
| 96 | 96 | } else { |
| 97 | 97 | $host = DB_SOCKET; |
| 98 | 98 | } |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | |
| 62 | 62 | if (!\lithium\data\Connections::get('default')) { |
| 63 | 63 | Users::applyFilter('save', |
| 64 | - function ($self, $params, $chain) |
|
| 64 | + function($self, $params, $chain) |
|
| 65 | 65 | { |
| 66 | 66 | if ($params['data']) { |
| 67 | 67 | $params['entity']->set($params['data']); |
@@ -61,8 +61,7 @@ |
||
| 61 | 61 | |
| 62 | 62 | if (!\lithium\data\Connections::get('default')) { |
| 63 | 63 | Users::applyFilter('save', |
| 64 | - function ($self, $params, $chain) |
|
| 65 | - { |
|
| 64 | + function ($self, $params, $chain) { |
|
| 66 | 65 | if ($params['data']) { |
| 67 | 66 | $params['entity']->set($params['data']); |
| 68 | 67 | $params['data'] = []; |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | continue; |
| 26 | 26 | } |
| 27 | 27 | $file = "{$config['path']}/config/routes.php"; |
| 28 | - file_exists($file) ? call_user_func(function () use ($file) { include $file; }) : null; |
|
| 28 | + file_exists($file) ? call_user_func(function() use ($file) { include $file; }) : null; |
|
| 29 | 29 | } |
| 30 | 30 | return $next($params); |
| 31 | 31 | }); |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | $cacheKey = 'core.libraries'; |
| 67 | 67 | |
| 68 | 68 | if ($cached = Cache::read('default', $cacheKey)) { |
| 69 | - $cached = (array) $cached + Libraries::cache(); |
|
| 69 | + $cached = (array)$cached + Libraries::cache(); |
|
| 70 | 70 | Libraries::cache($cached); |
| 71 | 71 | } |
| 72 | 72 | $result = $next($params); |