Skip to content

Commit 5521894

Browse files
authored
Merge pull request #1863 from atishamte/typos
Module wise Typos changes
2 parents b5c3f18 + bc69e18 commit 5521894

56 files changed

Lines changed: 252 additions & 244 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

system/Autoloader/Autoloader.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php namespace CodeIgniter\Autoloader;
22

3-
use Composer\Autoload\ClassLoader;
4-
53
/**
64
* CodeIgniter
75
*

system/CLI/CLI.php

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,13 @@ public static function input(string $prefix = null): string
204204
* $email = CLI::prompt('What is your email?', null, 'required|valid_email');
205205
*
206206
* @param string $field Output "field" question
207-
* @param string|array $options String to a defaul value, array to a list of options (the first option will be the default value)
207+
* @param string|array $options String to a default value, array to a list of options (the first option will be the default value)
208208
* @param string $validation Validation rules
209209
*
210210
* @return string The user input
211211
* @codeCoverageIgnore
212212
*/
213-
public static function prompt($field, $options = null, $validation = null): string
213+
public static function prompt(string $field, $options = null, string $validation = null): string
214214
{
215215
$extra_output = '';
216216
$default = '';
@@ -270,7 +270,7 @@ public static function prompt($field, $options = null, $validation = null): stri
270270
* @return boolean
271271
* @codeCoverageIgnore
272272
*/
273-
protected static function validate($field, $value, $rules)
273+
protected static function validate(string $field, string $value, string $rules): bool
274274
{
275275
$validation = \Config\Services::validation(null, false);
276276
$validation->setRule($field, null, $rules);
@@ -380,10 +380,12 @@ public static function wait(int $seconds, bool $countdown = false)
380380

381381
/**
382382
* if operating system === windows
383+
*
384+
* @return boolean
383385
*/
384-
public static function isWindows()
386+
public static function isWindows(): bool
385387
{
386-
return stripos(PHP_OS, 'WIN') === 0;
388+
return stripos(PHP_OS, 'WIN') === 0;
387389
}
388390

389391
//--------------------------------------------------------------------
@@ -436,7 +438,7 @@ public static function clearScreen()
436438
*
437439
* @return string The color coded string
438440
*/
439-
public static function color(string $text, string $foreground, string $background = null, string $format = null)
441+
public static function color(string $text, string $foreground, string $background = null, string $format = null): string
440442
{
441443
if (static::isWindows() && ! isset($_SERVER['ANSICON']))
442444
{
@@ -655,7 +657,7 @@ public static function wrap(string $string = null, int $max = 0, int $pad_left =
655657
* Parses the command line it was called from and collects all
656658
* options and valid segments.
657659
*
658-
* I tried to use getopt but had it fail occassionally to find any
660+
* I tried to use getopt but had it fail occasionally to find any
659661
* options but argc has always had our back. We don't have all of the power
660662
* of getopt but this does us just fine.
661663
*/
@@ -706,7 +708,7 @@ protected static function parseCommandLine()
706708
*
707709
* @return string
708710
*/
709-
public static function getURI()
711+
public static function getURI(): string
710712
{
711713
return implode('/', static::$segments);
712714
}
@@ -743,7 +745,7 @@ public static function getSegment(int $index)
743745
*
744746
* @return array
745747
*/
746-
public static function getSegments()
748+
public static function getSegments(): array
747749
{
748750
return static::$segments;
749751
}
@@ -779,7 +781,7 @@ public static function getOption(string $name)
779781
*
780782
* @return array
781783
*/
782-
public static function getOptions()
784+
public static function getOptions(): array
783785
{
784786
return static::$options;
785787
}
@@ -819,12 +821,12 @@ public static function getOptionString(): string
819821
//--------------------------------------------------------------------
820822

821823
/**
822-
* Returns a well formated table
824+
* Returns a well formatted table
823825
*
824826
* @param array $tbody List of rows
825827
* @param array $thead List of columns
826828
*
827-
* @return string
829+
* @return void
828830
*/
829831
public static function table(array $tbody, array $thead = [])
830832
{

system/CLI/CommandRunner.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ class CommandRunner extends Controller
6363
*
6464
* @param string $method
6565
* @param array ...$params
66+
*
67+
* @throws \ReflectionException
6668
*/
6769
public function _remap($method, ...$params)
6870
{
@@ -81,6 +83,7 @@ public function _remap($method, ...$params)
8183
* @param array $params
8284
*
8385
* @return mixed
86+
* @throws \ReflectionException
8487
*/
8588
public function index(array $params)
8689
{
@@ -128,6 +131,8 @@ protected function runCommand(string $command, array $params)
128131
/**
129132
* Scans all Commands directories and prepares a list
130133
* of each command with it's group and file.
134+
*
135+
* @throws \ReflectionException
131136
*/
132137
protected function createCommandList()
133138
{

system/CLI/Console.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function __construct(CodeIgniter $app)
6868
* @param boolean $useSafeOutput
6969
*
7070
* @return \CodeIgniter\HTTP\RequestInterface|\CodeIgniter\HTTP\Response|\CodeIgniter\HTTP\ResponseInterface|mixed
71-
* @throws \CodeIgniter\HTTP\RedirectException
71+
* @throws \CodeIgniter\Router\RedirectException
7272
*/
7373
public function run(bool $useSafeOutput = false)
7474
{

system/Cache/Handlers/PredisHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*/
3838

3939
use CodeIgniter\Cache\CacheInterface;
40-
use CodeIgniter\CriticalError;
40+
use CodeIgniter\Exceptions\CriticalError;
4141

4242
class PredisHandler implements CacheInterface
4343
{

system/Cache/Handlers/RedisHandler.php

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
* @filesource
3737
*/
3838

39-
use CodeIgniter\Exceptions\CriticalError;
4039
use CodeIgniter\Cache\CacheInterface;
4140

4241
class RedisHandler implements CacheInterface
@@ -106,28 +105,19 @@ public function initialize()
106105
$config = $this->config;
107106

108107
$this->redis = new \Redis();
108+
if (!$this->redis->connect($config['host'], ($config['host'][0] === '/' ? 0 : $config['port']), $config['timeout']))
109+
{
110+
log_message('error', 'Cache: Redis connection failed. Check your configuration.');
111+
}
109112

110-
try
113+
if (isset($config['password']) && !$this->redis->auth($config['password']))
111114
{
112-
if (! $this->redis->connect($config['host'], ($config['host'][0] === '/' ? 0 : $config['port']), $config['timeout'])
113-
)
114-
{
115-
// log_message('error', 'Cache: Redis connection failed. Check your configuration.');
116-
}
117-
118-
if (isset($config['password']) && ! $this->redis->auth($config['password']))
119-
{
120-
log_message('error', 'Cache: Redis authentication failed.');
121-
}
122-
123-
if (isset($config['database']) && ! $this->redis->select($config['database']))
124-
{
125-
log_message('error', 'Cache: Redis select database failed.');
126-
}
115+
log_message('error', 'Cache: Redis authentication failed.');
127116
}
128-
catch (\RedisException $e)
117+
118+
if (isset($config['database']) && !$this->redis->select($config['database']))
129119
{
130-
throw new CriticalError('Cache: Redis connection refused (' . $e->getMessage() . ')');
120+
log_message('error', 'Cache: Redis select database failed.');
131121
}
132122
}
133123

system/CodeIgniter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ public function cachePage(Cache $config)
615615
*
616616
* @return array
617617
*/
618-
public function getPerformanceStats()
618+
public function getPerformanceStats(): array
619619
{
620620
return [
621621
'startTime' => $this->startTime,

system/Commands/Help.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
*/
3838

3939
use CodeIgniter\CLI\BaseCommand;
40-
use CodeIgniter\CLI\CLI;
4140

4241
/**
4342
* CI Help command for the spark script.

system/Commands/Utilities/Routes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1616
* copies of the Software, and to permit persons to whom the Software is
1717
* furnished to do so, subject to the following conditions:
18-
*RouRouddfdf
18+
*
1919
* The above copyright notice and this permission notice shall be included in
2020
* all copies or substantial portions of the Software.
2121
*

system/Config/BaseConfig.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ protected function getEnvValue(string $property, string $prefix, string $shortPr
167167
/**
168168
* Provides external libraries a simple way to register one or more
169169
* options into a config file.
170+
*
171+
* @throws \ReflectionException
170172
*/
171173
protected function registerProperties()
172174
{

0 commit comments

Comments
 (0)