@@ -44,7 +44,7 @@ |
||
44 | 44 | } |
45 | 45 | |
46 | 46 | //logout exception |
47 | - $this->logoutException(); |
|
47 | + $this->logoutException(); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | /** |
8 | 8 | * @var array $params |
9 | 9 | */ |
10 | - public $params=[]; |
|
10 | + public $params = []; |
|
11 | 11 | |
12 | 12 | /** |
13 | 13 | * @return bool |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | { |
25 | 25 | // if the status value is true, |
26 | 26 | // we send output generated from the token value. |
27 | - if($this->checkStatus()){ |
|
27 | + if ($this->checkStatus()) { |
|
28 | 28 | return true; |
29 | 29 | } |
30 | 30 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | { |
40 | 40 | // if the status value is true, |
41 | 41 | // we send output generated from the token value. |
42 | - if($this->checkStatus()){ |
|
42 | + if ($this->checkStatus()) { |
|
43 | 43 | return true; |
44 | 44 | } |
45 | 45 | |
@@ -52,11 +52,11 @@ discard block |
||
52 | 52 | */ |
53 | 53 | protected function getResult() |
54 | 54 | { |
55 | - $result= []; |
|
55 | + $result = []; |
|
56 | 56 | |
57 | 57 | // if the status value is true, |
58 | 58 | // we send output generated from the token value. |
59 | - if($this->checkStatus()){ |
|
59 | + if ($this->checkStatus()) { |
|
60 | 60 | $result['message'] = 'token success'; |
61 | 61 | $result['token'] = $this->params['token']; |
62 | 62 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | } |
66 | 66 | |
67 | 67 | //in the params property, we set the exception type according to the exception value. |
68 | - $exceptionType=(isset($this->params['exception'])) ? $this->params['exception'] : 'credentials'; |
|
68 | + $exceptionType = (isset($this->params['exception'])) ? $this->params['exception'] : 'credentials'; |
|
69 | 69 | |
70 | 70 | // if the status is unsuccessful, |
71 | 71 | // the direct exception will be thrown away. |
@@ -77,7 +77,9 @@ |
||
77 | 77 | |
78 | 78 | // if you want to see the entire login manager object directly, |
79 | 79 | // send true to the objectReturn parameter. |
80 | - if($objectReturn) return $loginManager; |
|
80 | + if($objectReturn) { |
|
81 | + return $loginManager; |
|
82 | + } |
|
81 | 83 | |
82 | 84 | // the login value stored in the params property of the login manager object will return a builder object. |
83 | 85 | // we will return the value of the login state as a boolean using the count method of this builder object. |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | class AuthenticateProvider extends ConfigProvider implements AuthenticateContract |
10 | 10 | { |
11 | 11 | //get auth response,auth exception,auth token and auth basic |
12 | - use AuthenticateResponse,AuthenticateException,AuthenticateToken,AuthenticateBasic; |
|
12 | + use AuthenticateResponse, AuthenticateException, AuthenticateToken, AuthenticateBasic; |
|
13 | 13 | |
14 | 14 | /** |
15 | 15 | * @var string |
@@ -25,11 +25,11 @@ discard block |
||
25 | 25 | { |
26 | 26 | // header to determine whether |
27 | 27 | // the token value is present and return a callback. |
28 | - return $this->checkTokenViaHeaders(function($token){ |
|
28 | + return $this->checkTokenViaHeaders(function($token) { |
|
29 | 29 | |
30 | 30 | // we send the user-supplied token value |
31 | 31 | // to the authCheckManager object. |
32 | - new AuthCheckManager($this,$token); |
|
32 | + new AuthCheckManager($this, $token); |
|
33 | 33 | |
34 | 34 | // as a result we send output according to |
35 | 35 | // the boolean value from the checkResult method. |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public function guard($guard) |
48 | 48 | { |
49 | - $this->guard=$guard; |
|
49 | + $this->guard = $guard; |
|
50 | 50 | |
51 | 51 | $this->setAuthenticateNeeds(); |
52 | 52 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | { |
63 | 63 | // we obtain the id value obtained via |
64 | 64 | // authenticate availability with the help of callback object. |
65 | - return $this->checkParamsViaAvailability('authId',function($id){ |
|
65 | + return $this->checkParamsViaAvailability('authId', function($id) { |
|
66 | 66 | return $id; |
67 | 67 | }); |
68 | 68 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * @param bool $objectReturn |
75 | 75 | * @return $this|mixed |
76 | 76 | */ |
77 | - public function login($credentials=null,$objectReturn=false) |
|
77 | + public function login($credentials = null, $objectReturn = false) |
|
78 | 78 | { |
79 | 79 | // we will determine whether |
80 | 80 | // the http path is correct for this method. |
@@ -82,11 +82,11 @@ discard block |
||
82 | 82 | |
83 | 83 | // we invoke the login manager and the properties |
84 | 84 | // that this class creates will inform us about user input. |
85 | - $loginManager = new AuthLoginManager($credentials,$this); |
|
85 | + $loginManager = new AuthLoginManager($credentials, $this); |
|
86 | 86 | |
87 | 87 | // if you want to see the entire login manager object directly, |
88 | 88 | // send true to the objectReturn parameter. |
89 | - if($objectReturn) return $loginManager; |
|
89 | + if ($objectReturn) return $loginManager; |
|
90 | 90 | |
91 | 91 | // the login value stored in the params property of the login manager object will return a builder object. |
92 | 92 | // we will return the value of the login state as a boolean using the count method of this builder object. |
@@ -106,11 +106,11 @@ discard block |
||
106 | 106 | |
107 | 107 | // header to determine whether |
108 | 108 | // the token value is present and return a callback. |
109 | - return $this->checkTokenViaHeaders(function($token){ |
|
109 | + return $this->checkTokenViaHeaders(function($token) { |
|
110 | 110 | |
111 | 111 | // we send the user-supplied token value |
112 | 112 | // to the authCheckManager object. |
113 | - new AuthLogoutManager($this,$token); |
|
113 | + new AuthLogoutManager($this, $token); |
|
114 | 114 | |
115 | 115 | // as a result we send output according to |
116 | 116 | // the boolean value from the checkResult method. |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | { |
128 | 128 | // we obtain the token value obtained via |
129 | 129 | // authenticate availability with the help of callback object. |
130 | - return $this->checkParamsViaAvailability('authToken',function($token){ |
|
130 | + return $this->checkParamsViaAvailability('authToken', function($token) { |
|
131 | 131 | return $token; |
132 | 132 | }); |
133 | 133 | } |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | { |
142 | 142 | // we obtain the user value obtained via |
143 | 143 | // authenticate availability with the help of callback object. |
144 | - return $this->checkParamsViaAvailability('auth',function($user){ |
|
144 | + return $this->checkParamsViaAvailability('auth', function($user) { |
|
145 | 145 | return $user; |
146 | 146 | }); |
147 | 147 | } |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | { |
156 | 156 | // we obtain the data value obtained via |
157 | 157 | // authenticate availability with the help of callback object. |
158 | - return $this->checkParamsViaAvailability('data',function($data){ |
|
158 | + return $this->checkParamsViaAvailability('data', function($data) { |
|
159 | 159 | return $data; |
160 | 160 | }); |
161 | 161 | } |
@@ -123,7 +123,9 @@ |
||
123 | 123 | } |
124 | 124 | |
125 | 125 | //this method may show continuity depending on the macro. |
126 | - if(false === $this instanceof $macro) return ; |
|
126 | + if(false === $this instanceof $macro) { |
|
127 | + return ; |
|
128 | + } |
|
127 | 129 | |
128 | 130 | // retrieve the cache item |
129 | 131 | $cacheItem = $this->cache->getItem($this->name); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function adapter($adapter) |
57 | 57 | { |
58 | - if(!is_null($adapter)){ |
|
58 | + if (!is_null($adapter)) { |
|
59 | 59 | $this->adapter = $adapter; |
60 | 60 | } |
61 | 61 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | { |
73 | 73 | //name variable is |
74 | 74 | //the name of the cache data set to be created. |
75 | - if(!is_null($name)){ |
|
75 | + if (!is_null($name)) { |
|
76 | 76 | $this->name = $name; |
77 | 77 | } |
78 | 78 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | { |
90 | 90 | //Cache data is set at the time. |
91 | 91 | //Data will be valid in this time. |
92 | - if(is_numeric($expire)){ |
|
92 | + if (is_numeric($expire)) { |
|
93 | 93 | $this->expire = $expire; |
94 | 94 | } |
95 | 95 | |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | { |
109 | 109 | // this class has a macro that can be managed by the user. |
110 | 110 | // macros work as an extensible version of the classes. |
111 | - $macro = $this->app['macro']->with(config('kernel.macros.cache'),$this,$this->adapter); |
|
111 | + $macro = $this->app['macro']->with(config('kernel.macros.cache'), $this, $this->adapter); |
|
112 | 112 | |
113 | 113 | //set cache macroable object |
114 | 114 | $this->cache = $macro->{$this->adapter}($callback); |
@@ -118,25 +118,25 @@ discard block |
||
118 | 118 | $backtrace = debug_backtrace()[1]; |
119 | 119 | |
120 | 120 | //If name is null, we name it with backtrace. |
121 | - if($this->name===null) { |
|
121 | + if ($this->name===null) { |
|
122 | 122 | $this->name = md5($backtrace['function'].'_'.$backtrace['class']); |
123 | 123 | } |
124 | 124 | |
125 | 125 | //this method may show continuity depending on the macro. |
126 | - if(false === $this instanceof $macro) return ; |
|
126 | + if (false===$this instanceof $macro) return; |
|
127 | 127 | |
128 | 128 | // retrieve the cache item |
129 | 129 | $cacheItem = $this->cache->getItem($this->name); |
130 | 130 | |
131 | 131 | if (!$cacheItem->isHit()) { |
132 | 132 | |
133 | - $data=call_user_func($callback); |
|
133 | + $data = call_user_func($callback); |
|
134 | 134 | $cacheItem->set($data); |
135 | 135 | $this->cache->save($cacheItem); |
136 | 136 | return $data; |
137 | 137 | } |
138 | 138 | |
139 | - $this->app->register('illuminator','cache',['name'=>$this->name]); |
|
139 | + $this->app->register('illuminator', 'cache', ['name'=>$this->name]); |
|
140 | 140 | |
141 | 141 | // retrieve the value stored by the item |
142 | 142 | return $cacheItem->get(); |
@@ -17,7 +17,7 @@ |
||
17 | 17 | public function cacheProcess($callback) |
18 | 18 | { |
19 | 19 | //we do cache key control for method cache container data. |
20 | - if(isset($this->app['containerReflection']['methodCache']['cache'])){ |
|
20 | + if (isset($this->app['containerReflection']['methodCache']['cache'])) { |
|
21 | 21 | |
22 | 22 | //get cache data |
23 | 23 | $cache = $this->app['containerReflection']['methodCache']['cache']; |
@@ -18,12 +18,12 @@ |
||
18 | 18 | */ |
19 | 19 | public function __construct() |
20 | 20 | { |
21 | - if(config('cache.default')!==null){ |
|
21 | + if (config('cache.default')!==null) { |
|
22 | 22 | |
23 | 23 | $default = config('cache.default'); |
24 | 24 | |
25 | 25 | $this->config['adapter'] = config('cache.stores.'.$default.'.driver') ?? exception()->invalidArgument('driver for '.$default.' within cache config is not valid'); |
26 | - $this->config['path'] = config('cache.stores.'.$default.'.path') ?? path()->appResourche().'/Cache' ; |
|
26 | + $this->config['path'] = config('cache.stores.'.$default.'.path') ?? path()->appResourche().'/Cache'; |
|
27 | 27 | $this->config['expire'] = config('cache.stores.'.$default.'.expire') ?? 0; |
28 | 28 | } |
29 | 29 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | { |
15 | 15 | //if the env file does not exist, we automatically detect |
16 | 16 | //that the environment variable is in the production environment. |
17 | - if(!file_exists($this->getEnvironmentPath())){ |
|
17 | + if (!file_exists($this->getEnvironmentPath())) { |
|
18 | 18 | return []; |
19 | 19 | } |
20 | 20 | |
@@ -29,10 +29,10 @@ discard block |
||
29 | 29 | * @param bool $status |
30 | 30 | * @return mixed |
31 | 31 | */ |
32 | - public function getEnvironment($status=false) |
|
32 | + public function getEnvironment($status = false) |
|
33 | 33 | { |
34 | 34 | //If the status value is false then direct path is invoked. If true is sent, variables are sent. |
35 | - return (false === $status) ? $this->getEnvironmentPath() : $this->getEnvironmentVariables(); |
|
35 | + return (false===$status) ? $this->getEnvironmentPath() : $this->getEnvironmentVariables(); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | private function identifierEnvironment() |
60 | 60 | { |
61 | 61 | //We parse our environment variables through the yaml file. |
62 | - $environment=$this->getEnvironment(true); |
|
62 | + $environment = $this->getEnvironment(true); |
|
63 | 63 | |
64 | 64 | //the application will automatically throw an exception |
65 | 65 | //if there is no env key in the parse variables. |
66 | - if(!isset($environment['env'])){ |
|
66 | + if (!isset($environment['env'])) { |
|
67 | 67 | exception()->invalidArgument('The env key missing on your environment'); |
68 | 68 | } |
69 | 69 |
@@ -14,14 +14,14 @@ discard block |
||
14 | 14 | * @param null $environment |
15 | 15 | * @return string |
16 | 16 | */ |
17 | - public function environment($var=array(),$environment=null) |
|
17 | + public function environment($var = array(), $environment = null) |
|
18 | 18 | { |
19 | 19 | //environment is recognized as a production environment directly |
20 | 20 | //if there is no env object in the environment variable. |
21 | 21 | $isProduction = $environment['env'] ?? 'production'; |
22 | 22 | |
23 | 23 | //we issue a controlled environment key map for the submitted environment |
24 | - return (count($var)===0) ? $isProduction : self::getEnvironmentForVariables($var,$environment); |
|
24 | + return (count($var)===0) ? $isProduction : self::getEnvironmentForVariables($var, $environment); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * @param null $environment |
32 | 32 | * @return mixed |
33 | 33 | */ |
34 | - private static function getEnvironmentForVariables($var=array(),$environment=null) |
|
34 | + private static function getEnvironmentForVariables($var = array(), $environment = null) |
|
35 | 35 | { |
36 | 36 | //environment variable specified by the variable is checked in the defined file |
37 | 37 | //and the value is returned accordingly. |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | public function handle() |
47 | 47 | { |
48 | 48 | //set define for config |
49 | - define ('environment',true); |
|
49 | + define('environment', true); |
|
50 | 50 | |
51 | 51 | //where we do the checks for the environment file type, |
52 | 52 | //and if no configuration file is found, the system throws an exception. |
@@ -62,10 +62,10 @@ discard block |
||
62 | 62 | * @param null $configuration |
63 | 63 | * @return void |
64 | 64 | */ |
65 | - private function set($configuration=null) |
|
65 | + private function set($configuration = null) |
|
66 | 66 | { |
67 | 67 | //we are doing global registration for env and var value. |
68 | - $this->app->register('environmentVariables',$configuration); |
|
69 | - $this->app->register('env',$this->environment([],$this->app['environmentVariables'])); |
|
68 | + $this->app->register('environmentVariables', $configuration); |
|
69 | + $this->app->register('env', $this->environment([], $this->app['environmentVariables'])); |
|
70 | 70 | } |
71 | 71 | } |
72 | 72 | \ No newline at end of file |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | |
21 | 21 | // command namespace |
22 | 22 | // call custom command namespace |
23 | - $commandNamespace = Utils::getNamespace(path()->command()) . '\\' . $this->app->getConsoleClass(); |
|
23 | + $commandNamespace = Utils::getNamespace(path()->command()).'\\'.$this->app->getConsoleClass(); |
|
24 | 24 | |
25 | 25 | //return null if there is no command namespace |
26 | 26 | if (!class_exists($commandNamespace)) return null; |
@@ -36,14 +36,14 @@ discard block |
||
36 | 36 | |
37 | 37 | // closure binding custom command,move custom namespace as specific |
38 | 38 | // call prepare commander firstly for checking command builder |
39 | - return ClosureDispatcher::bind($app)->call(function () use($commandClassResolved,$app) { |
|
39 | + return ClosureDispatcher::bind($app)->call(function() use($commandClassResolved, $app) { |
|
40 | 40 | |
41 | 41 | $this->prepareCommander($commandClassResolved, function($commandClassResolved) use($app) { |
42 | 42 | |
43 | 43 | // call bindings for resolving |
44 | 44 | // call with dependency injection resolving |
45 | - $commandBindings=[$commandClassResolved,strtolower($app->getConsoleClassMethod())]; |
|
46 | - return DIContainerManager::callBind($commandBindings,app()->applicationProviderBinding($this->app)); |
|
45 | + $commandBindings = [$commandClassResolved, strtolower($app->getConsoleClassMethod())]; |
|
46 | + return DIContainerManager::callBind($commandBindings, app()->applicationProviderBinding($this->app)); |
|
47 | 47 | |
48 | 48 | }); |
49 | 49 | }); |
@@ -23,7 +23,9 @@ |
||
23 | 23 | $commandNamespace = Utils::getNamespace(path()->command()) . '\\' . $this->app->getConsoleClass(); |
24 | 24 | |
25 | 25 | //return null if there is no command namespace |
26 | - if (!class_exists($commandNamespace)) return null; |
|
26 | + if (!class_exists($commandNamespace)) { |
|
27 | + return null; |
|
28 | + } |
|
27 | 29 | |
28 | 30 | //get class resolved |
29 | 31 | $commandClassResolved = app()->resolve($commandNamespace, |
@@ -265,13 +265,13 @@ discard block |
||
265 | 265 | */ |
266 | 266 | function setBorder($border) |
267 | 267 | { |
268 | - if ($border === CONSOLE_TABLE_BORDER_ASCII) { |
|
268 | + if ($border===CONSOLE_TABLE_BORDER_ASCII) { |
|
269 | 269 | $intersection = '+'; |
270 | 270 | $horizontal = '-'; |
271 | 271 | $vertical = '|'; |
272 | 272 | } else if (is_string($border)) { |
273 | 273 | $intersection = $horizontal = $vertical = $border; |
274 | - } else if ($border == '') { |
|
274 | + } else if ($border=='') { |
|
275 | 275 | $intersection = $horizontal = $vertical = ''; |
276 | 276 | } else { |
277 | 277 | extract($border); |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | $this->_data[$row_id++][$col_id] = $col_cell; |
399 | 399 | } |
400 | 400 | $this->_updateRowsCols(); |
401 | - $this->_max_cols = max($this->_max_cols, $col_id + 1); |
|
401 | + $this->_max_cols = max($this->_max_cols, $col_id+1); |
|
402 | 402 | } |
403 | 403 | /** |
404 | 404 | * Adds data to the table. |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | function addData($data, $col_id = 0, $row_id = 0) |
413 | 413 | { |
414 | 414 | foreach ($data as $row) { |
415 | - if ($row === CONSOLE_TABLE_HORIZONTAL_RULE) { |
|
415 | + if ($row===CONSOLE_TABLE_HORIZONTAL_RULE) { |
|
416 | 416 | $this->_data[$row_id] = CONSOLE_TABLE_HORIZONTAL_RULE; |
417 | 417 | $row_id++; |
418 | 418 | continue; |
@@ -483,7 +483,7 @@ discard block |
||
483 | 483 | $column = $filter[0]; |
484 | 484 | $callback = $filter[1]; |
485 | 485 | foreach ($this->_data as $row_id => $row_data) { |
486 | - if ($row_data !== CONSOLE_TABLE_HORIZONTAL_RULE) { |
|
486 | + if ($row_data!==CONSOLE_TABLE_HORIZONTAL_RULE) { |
|
487 | 487 | $this->_data[$row_id][$column] = |
488 | 488 | call_user_func($callback, $row_data[$column]); |
489 | 489 | } |
@@ -500,25 +500,25 @@ discard block |
||
500 | 500 | if (!empty($this->_headers)) { |
501 | 501 | $this->_calculateRowHeight(-1, $this->_headers[0]); |
502 | 502 | } |
503 | - for ($i = 0; $i < $this->_max_rows; $i++) { |
|
504 | - for ($j = 0; $j < $this->_max_cols; $j++) { |
|
503 | + for ($i = 0; $i<$this->_max_rows; $i++) { |
|
504 | + for ($j = 0; $j<$this->_max_cols; $j++) { |
|
505 | 505 | if (!isset($this->_data[$i][$j]) && |
506 | 506 | (!isset($this->_data[$i]) || |
507 | - $this->_data[$i] !== CONSOLE_TABLE_HORIZONTAL_RULE)) { |
|
507 | + $this->_data[$i]!==CONSOLE_TABLE_HORIZONTAL_RULE)) { |
|
508 | 508 | $this->_data[$i][$j] = ''; |
509 | 509 | } |
510 | 510 | } |
511 | 511 | $this->_calculateRowHeight($i, $this->_data[$i]); |
512 | - if ($this->_data[$i] !== CONSOLE_TABLE_HORIZONTAL_RULE) { |
|
512 | + if ($this->_data[$i]!==CONSOLE_TABLE_HORIZONTAL_RULE) { |
|
513 | 513 | ksort($this->_data[$i]); |
514 | 514 | } |
515 | 515 | } |
516 | 516 | $this->_splitMultilineRows(); |
517 | 517 | // Update cell lengths. |
518 | - for ($i = 0; $i < count($this->_headers); $i++) { |
|
518 | + for ($i = 0; $i<count($this->_headers); $i++) { |
|
519 | 519 | $this->_calculateCellLengths($this->_headers[$i]); |
520 | 520 | } |
521 | - for ($i = 0; $i < $this->_max_rows; $i++) { |
|
521 | + for ($i = 0; $i<$this->_max_rows; $i++) { |
|
522 | 522 | $this->_calculateCellLengths($this->_data[$i]); |
523 | 523 | } |
524 | 524 | ksort($this->_data); |
@@ -534,24 +534,24 @@ discard block |
||
534 | 534 | $sections = array(&$this->_headers, &$this->_data); |
535 | 535 | $max_rows = array(count($this->_headers), $this->_max_rows); |
536 | 536 | $row_height_offset = array(-1, 0); |
537 | - for ($s = 0; $s <= 1; $s++) { |
|
537 | + for ($s = 0; $s<=1; $s++) { |
|
538 | 538 | $inserted = 0; |
539 | 539 | $new_data = $sections[$s]; |
540 | - for ($i = 0; $i < $max_rows[$s]; $i++) { |
|
540 | + for ($i = 0; $i<$max_rows[$s]; $i++) { |
|
541 | 541 | // Process only rows that have many lines. |
542 | - $height = $this->_row_heights[$i + $row_height_offset[$s]]; |
|
543 | - if ($height > 1) { |
|
542 | + $height = $this->_row_heights[$i+$row_height_offset[$s]]; |
|
543 | + if ($height>1) { |
|
544 | 544 | // Split column data into one-liners. |
545 | 545 | $split = array(); |
546 | - for ($j = 0; $j < $this->_max_cols; $j++) { |
|
546 | + for ($j = 0; $j<$this->_max_cols; $j++) { |
|
547 | 547 | $split[$j] = preg_split('/\r?\n|\r/', |
548 | 548 | $sections[$s][$i][$j]); |
549 | 549 | } |
550 | 550 | $new_rows = array(); |
551 | 551 | // Construct new 'virtual' rows - insert empty strings for |
552 | 552 | // columns that have less lines that the highest one. |
553 | - for ($i2 = 0; $i2 < $height; $i2++) { |
|
554 | - for ($j = 0; $j < $this->_max_cols; $j++) { |
|
553 | + for ($i2 = 0; $i2<$height; $i2++) { |
|
554 | + for ($j = 0; $j<$this->_max_cols; $j++) { |
|
555 | 555 | $new_rows[$i2][$j] = !isset($split[$j][$i2]) |
556 | 556 | ? '' |
557 | 557 | : $split[$j][$i2]; |
@@ -560,12 +560,12 @@ discard block |
||
560 | 560 | // Replace current row with smaller rows. $inserted is |
561 | 561 | // used to take account of bigger array because of already |
562 | 562 | // inserted rows. |
563 | - array_splice($new_data, $i + $inserted, 1, $new_rows); |
|
564 | - $inserted += count($new_rows) - 1; |
|
563 | + array_splice($new_data, $i+$inserted, 1, $new_rows); |
|
564 | + $inserted += count($new_rows)-1; |
|
565 | 565 | } |
566 | 566 | } |
567 | 567 | // Has the data been modified? |
568 | - if ($inserted > 0) { |
|
568 | + if ($inserted>0) { |
|
569 | 569 | $sections[$s] = $new_data; |
570 | 570 | $this->_updateRowsCols(); |
571 | 571 | } |
@@ -584,10 +584,10 @@ discard block |
||
584 | 584 | $vertical = $this->_border['vertical']; |
585 | 585 | $separator = $this->_getSeparator(); |
586 | 586 | $return = array(); |
587 | - for ($i = 0; $i < count($this->_data); $i++) { |
|
588 | - for ($j = 0; $j < count($this->_data[$i]); $j++) { |
|
589 | - if ($this->_data[$i] !== CONSOLE_TABLE_HORIZONTAL_RULE && |
|
590 | - $this->_strlen($this->_data[$i][$j]) < |
|
587 | + for ($i = 0; $i<count($this->_data); $i++) { |
|
588 | + for ($j = 0; $j<count($this->_data[$i]); $j++) { |
|
589 | + if ($this->_data[$i]!==CONSOLE_TABLE_HORIZONTAL_RULE && |
|
590 | + $this->_strlen($this->_data[$i][$j])< |
|
591 | 591 | $this->_cell_lengths[$j]) { |
592 | 592 | $this->_data[$i][$j] = $this->_strpad($this->_data[$i][$j], |
593 | 593 | $this->_cell_lengths[$j], |
@@ -595,17 +595,17 @@ discard block |
||
595 | 595 | $this->_col_align[$j]); |
596 | 596 | } |
597 | 597 | } |
598 | - if ($this->_data[$i] !== CONSOLE_TABLE_HORIZONTAL_RULE) { |
|
598 | + if ($this->_data[$i]!==CONSOLE_TABLE_HORIZONTAL_RULE) { |
|
599 | 599 | $row_begin = $this->_borderVisibility['left'] |
600 | - ? $vertical . str_repeat(' ', $this->_padding) |
|
600 | + ? $vertical.str_repeat(' ', $this->_padding) |
|
601 | 601 | : ''; |
602 | 602 | $row_end = $this->_borderVisibility['right'] |
603 | - ? str_repeat(' ', $this->_padding) . $vertical |
|
603 | + ? str_repeat(' ', $this->_padding).$vertical |
|
604 | 604 | : ''; |
605 | - $implode_char = str_repeat(' ', $this->_padding) . $vertical |
|
605 | + $implode_char = str_repeat(' ', $this->_padding).$vertical |
|
606 | 606 | . str_repeat(' ', $this->_padding); |
607 | 607 | $return[] = $row_begin |
608 | - . implode($implode_char, $this->_data[$i]) . $row_end; |
|
608 | + . implode($implode_char, $this->_data[$i]).$row_end; |
|
609 | 609 | } elseif (!empty($separator)) { |
610 | 610 | $return[] = $separator; |
611 | 611 | } |
@@ -613,15 +613,15 @@ discard block |
||
613 | 613 | $return = implode(PHP_EOL, $return); |
614 | 614 | if (!empty($separator)) { |
615 | 615 | if ($this->_borderVisibility['inner']) { |
616 | - $return = $separator . PHP_EOL . $return; |
|
616 | + $return = $separator.PHP_EOL.$return; |
|
617 | 617 | } |
618 | 618 | if ($this->_borderVisibility['bottom']) { |
619 | - $return .= PHP_EOL . $separator; |
|
619 | + $return .= PHP_EOL.$separator; |
|
620 | 620 | } |
621 | 621 | } |
622 | 622 | $return .= PHP_EOL; |
623 | 623 | if (!empty($this->_headers)) { |
624 | - $return = $this->_getHeaderLine() . PHP_EOL . $return; |
|
624 | + $return = $this->_getHeaderLine().PHP_EOL.$return; |
|
625 | 625 | } |
626 | 626 | return $return; |
627 | 627 | } |
@@ -643,14 +643,14 @@ discard block |
||
643 | 643 | $return[] = str_repeat($horizontal, $cl); |
644 | 644 | } |
645 | 645 | $row_begin = $this->_borderVisibility['left'] |
646 | - ? $intersection . str_repeat($horizontal, $this->_padding) |
|
646 | + ? $intersection.str_repeat($horizontal, $this->_padding) |
|
647 | 647 | : ''; |
648 | 648 | $row_end = $this->_borderVisibility['right'] |
649 | - ? str_repeat($horizontal, $this->_padding) . $intersection |
|
649 | + ? str_repeat($horizontal, $this->_padding).$intersection |
|
650 | 650 | : ''; |
651 | - $implode_char = str_repeat($horizontal, $this->_padding) . $intersection |
|
651 | + $implode_char = str_repeat($horizontal, $this->_padding).$intersection |
|
652 | 652 | . str_repeat($horizontal, $this->_padding); |
653 | - return $row_begin . implode($implode_char, $return) . $row_end; |
|
653 | + return $row_begin.implode($implode_char, $return).$row_end; |
|
654 | 654 | } |
655 | 655 | /** |
656 | 656 | * Returns the header line for the table. |
@@ -660,16 +660,16 @@ discard block |
||
660 | 660 | function _getHeaderLine() |
661 | 661 | { |
662 | 662 | // Make sure column count is correct |
663 | - for ($j = 0; $j < count($this->_headers); $j++) { |
|
664 | - for ($i = 0; $i < $this->_max_cols; $i++) { |
|
663 | + for ($j = 0; $j<count($this->_headers); $j++) { |
|
664 | + for ($i = 0; $i<$this->_max_cols; $i++) { |
|
665 | 665 | if (!isset($this->_headers[$j][$i])) { |
666 | 666 | $this->_headers[$j][$i] = ''; |
667 | 667 | } |
668 | 668 | } |
669 | 669 | } |
670 | - for ($j = 0; $j < count($this->_headers); $j++) { |
|
671 | - for ($i = 0; $i < count($this->_headers[$j]); $i++) { |
|
672 | - if ($this->_strlen($this->_headers[$j][$i]) < |
|
670 | + for ($j = 0; $j<count($this->_headers); $j++) { |
|
671 | + for ($i = 0; $i<count($this->_headers[$j]); $i++) { |
|
672 | + if ($this->_strlen($this->_headers[$j][$i])< |
|
673 | 673 | $this->_cell_lengths[$i]) { |
674 | 674 | $this->_headers[$j][$i] = |
675 | 675 | $this->_strpad($this->_headers[$j][$i], |
@@ -681,20 +681,20 @@ discard block |
||
681 | 681 | } |
682 | 682 | $vertical = $this->_border['vertical']; |
683 | 683 | $row_begin = $this->_borderVisibility['left'] |
684 | - ? $vertical . str_repeat(' ', $this->_padding) |
|
684 | + ? $vertical.str_repeat(' ', $this->_padding) |
|
685 | 685 | : ''; |
686 | 686 | $row_end = $this->_borderVisibility['right'] |
687 | - ? str_repeat(' ', $this->_padding) . $vertical |
|
687 | + ? str_repeat(' ', $this->_padding).$vertical |
|
688 | 688 | : ''; |
689 | - $implode_char = str_repeat(' ', $this->_padding) . $vertical |
|
689 | + $implode_char = str_repeat(' ', $this->_padding).$vertical |
|
690 | 690 | . str_repeat(' ', $this->_padding); |
691 | 691 | $separator = $this->_getSeparator(); |
692 | 692 | if (!empty($separator) && $this->_borderVisibility['top']) { |
693 | 693 | $return[] = $separator; |
694 | 694 | } |
695 | - for ($j = 0; $j < count($this->_headers); $j++) { |
|
695 | + for ($j = 0; $j<count($this->_headers); $j++) { |
|
696 | 696 | $return[] = $row_begin |
697 | - . implode($implode_char, $this->_headers[$j]) . $row_end; |
|
697 | + . implode($implode_char, $this->_headers[$j]).$row_end; |
|
698 | 698 | } |
699 | 699 | return implode(PHP_EOL, $return); |
700 | 700 | } |
@@ -712,7 +712,7 @@ discard block |
||
712 | 712 | // Update maximum rows. |
713 | 713 | ksort($this->_data); |
714 | 714 | $keys = array_keys($this->_data); |
715 | - $this->_max_rows = end($keys) + 1; |
|
715 | + $this->_max_rows = end($keys)+1; |
|
716 | 716 | switch ($this->_defaultAlign) { |
717 | 717 | case CONSOLE_TABLE_ALIGN_CENTER: |
718 | 718 | $pad = STR_PAD_BOTH; |
@@ -725,7 +725,7 @@ discard block |
||
725 | 725 | break; |
726 | 726 | } |
727 | 727 | // Set default column alignments |
728 | - for ($i = 0; $i < $this->_max_cols; $i++) { |
|
728 | + for ($i = 0; $i<$this->_max_cols; $i++) { |
|
729 | 729 | if (!isset($this->_col_align[$i])) { |
730 | 730 | $this->_col_align[$i] = $pad; |
731 | 731 | } |
@@ -740,7 +740,7 @@ discard block |
||
740 | 740 | */ |
741 | 741 | function _calculateCellLengths($row) |
742 | 742 | { |
743 | - for ($i = 0; $i < count($row); $i++) { |
|
743 | + for ($i = 0; $i<count($row); $i++) { |
|
744 | 744 | if (!isset($this->_cell_lengths[$i])) { |
745 | 745 | $this->_cell_lengths[$i] = 0; |
746 | 746 | } |
@@ -762,10 +762,10 @@ discard block |
||
762 | 762 | $this->_row_heights[$row_number] = 1; |
763 | 763 | } |
764 | 764 | // Do not process horizontal rule rows. |
765 | - if ($row === CONSOLE_TABLE_HORIZONTAL_RULE) { |
|
765 | + if ($row===CONSOLE_TABLE_HORIZONTAL_RULE) { |
|
766 | 766 | return; |
767 | 767 | } |
768 | - for ($i = 0, $c = count($row); $i < $c; ++$i) { |
|
768 | + for ($i = 0, $c = count($row); $i<$c; ++$i) { |
|
769 | 769 | $lines = preg_split('/\r?\n|\r/', $row[$i]); |
770 | 770 | $this->_row_heights[$row_number] = max($this->_row_heights[$row_number], |
771 | 771 | count($lines)); |
@@ -841,31 +841,31 @@ discard block |
||
841 | 841 | $sb_length = strlen($input); |
842 | 842 | $pad_length = $this->_strlen($pad); |
843 | 843 | /* Return if we already have the length. */ |
844 | - if ($mb_length >= $length) { |
|
844 | + if ($mb_length>=$length) { |
|
845 | 845 | return $input; |
846 | 846 | } |
847 | 847 | /* Shortcut for single byte strings. */ |
848 | - if ($mb_length == $sb_length && $pad_length == strlen($pad)) { |
|
848 | + if ($mb_length==$sb_length && $pad_length==strlen($pad)) { |
|
849 | 849 | return str_pad($input, $length, $pad, $type); |
850 | 850 | } |
851 | 851 | switch ($type) { |
852 | 852 | case STR_PAD_LEFT: |
853 | - $left = $length - $mb_length; |
|
853 | + $left = $length-$mb_length; |
|
854 | 854 | $output = $this->_substr(str_repeat($pad, ceil($left / $pad_length)), |
855 | - 0, $left, $this->_charset) . $input; |
|
855 | + 0, $left, $this->_charset).$input; |
|
856 | 856 | break; |
857 | 857 | case STR_PAD_BOTH: |
858 | - $left = floor(($length - $mb_length) / 2); |
|
859 | - $right = ceil(($length - $mb_length) / 2); |
|
858 | + $left = floor(($length-$mb_length) / 2); |
|
859 | + $right = ceil(($length-$mb_length) / 2); |
|
860 | 860 | $output = $this->_substr(str_repeat($pad, ceil($left / $pad_length)), |
861 | - 0, $left, $this->_charset) . |
|
862 | - $input . |
|
861 | + 0, $left, $this->_charset). |
|
862 | + $input. |
|
863 | 863 | $this->_substr(str_repeat($pad, ceil($right / $pad_length)), |
864 | 864 | 0, $right, $this->_charset); |
865 | 865 | break; |
866 | 866 | case STR_PAD_RIGHT: |
867 | - $right = $length - $mb_length; |
|
868 | - $output = $input . |
|
867 | + $right = $length-$mb_length; |
|
868 | + $output = $input. |
|
869 | 869 | $this->_substr(str_repeat($pad, ceil($right / $pad_length)), |
870 | 870 | 0, $right, $this->_charset); |
871 | 871 | break; |