Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions system/CLI/BaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,26 +193,6 @@ public function setPad(string $item, int $max, int $extra = 2, int $indent = 0):
return str_pad(str_repeat(' ', $indent) . $item, $max);
}

/**
* Get pad for $key => $value array output
*
* @param array<string, string> $array
*
* @deprecated Use setPad() instead.
*
* @codeCoverageIgnore
*/
public function getPad(array $array, int $pad): int
{
$max = 0;

foreach (array_keys($array) as $key) {
$max = max($max, strlen($key));
}

return $max + $pad;
}

/**
* Makes it simple to access our protected properties.
*
Expand Down
34 changes: 2 additions & 32 deletions system/CLI/CLI.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,10 @@
*/
class CLI
{
/**
* Is the readline library on the system?
*
* @var bool
*
* @deprecated 4.4.2 Should be protected, and no longer used.
* @TODO Fix to camelCase in the next major version.
*/
public static $readline_support = false;

/**
* The message displayed at prompts.
*
* @var string
*
* @deprecated 4.4.2 Should be protected.
* @TODO Fix to camelCase in the next major version.
*/
public static $wait_msg = 'Press any key to continue...';
protected static string $waitMsg = 'Press any key to continue...';

/**
* Has the class already been initialized?
Expand Down Expand Up @@ -159,11 +144,6 @@ class CLI
public static function init()
{
if (is_cli()) {
// Readline is an extension for PHP that makes interactivity with PHP
// much more bash-like.
// http://www.php.net/manual/en/readline.installation.php
static::$readline_support = extension_loaded('readline');

// clear segments & options to keep testing clean
static::$segments = [];
static::$options = [];
Expand Down Expand Up @@ -522,21 +502,11 @@ public static function wait(int $seconds, bool $countdown = false)
} elseif ($seconds > 0) {
sleep($seconds);
} else {
static::write(static::$wait_msg);
static::write(static::$waitMsg);
static::$io->input();
}
}

/**
* if operating system === windows
*
* @deprecated 4.3.0 Use `is_windows()` instead
*/
public static function isWindows(): bool
{
return is_windows();
}

/**
* Enter a number of empty lines
*
Expand Down
12 changes: 0 additions & 12 deletions system/CLI/GeneratorTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,6 @@ trait GeneratorTrait
*/
private $params = [];

/**
* Execute the command.
*
* @param array<int|string, string|null> $params
*
* @deprecated use generateClass() instead
*/
protected function execute(array $params): void
{
$this->generateClass($params);
}

/**
* Generates a class file from an existing template.
*
Expand Down
6 changes: 6 additions & 0 deletions user_guide_src/source/changelogs/v4.8.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ Removed Deprecated Items
- ``CodeIgniter\Cache\Handlers\FileHandler::deleteFile()``
- ``CodeIgniter\Cache\Handlers\FileHandler::getDirFileInfo()``
- ``CodeIgniter\Cache\Handlers\FileHandler::getFileInfo()``
- **CLI:** Removed the following properties and methods deprecated:
- ``CodeIgniter\CLI\BaseCommand::getPad()``
- ``CodeIgniter\CLI\CLI::$readline_support``
- ``CodeIgniter\CLI\CLI::$wait_msg``
- ``CodeIgniter\CLI\CLI::isWindows()``
- ``CodeIgniter\CLI\GeneratorTrait::execute()``
- **CodeIgniter:** Removed the following properties and methods deprecated:
- ``CodeIgniter\CodeIgniter::$cacheTTL``
- ``CodeIgniter\CodeIgniter::$returnResponse``
Expand Down
10 changes: 0 additions & 10 deletions user_guide_src/source/cli/cli_commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,3 @@ be familiar with when creating your own commands. It also has a :doc:`Logger </g

.. literalinclude:: cli_commands/007.php
:lines: 2-

.. php:method:: getPad($array, $pad)
.. deprecated:: 4.0.5
Use :php:meth:`CodeIgniter\\CLI\\BaseCommand::setPad()` instead.

:param array $array: The $key => $value array.
:param integer $pad: The pad spaces.

A method to calculate padding for ``$key => $value`` array output. The padding can be used to output a will formatted table in CLI.
Loading