Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PHPDocs for CLI #3289

Merged
merged 1 commit into from
Jul 12, 2020
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
7 changes: 4 additions & 3 deletions system/CLI/BaseCommand.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* CodeIgniter
*
Expand Down Expand Up @@ -106,7 +107,7 @@ abstract class BaseCommand
* Instance of the CommandRunner controller
* so commands can call other commands.
*
* @var \CodeIgniter\CLI\CommandRunner
* @var \CodeIgniter\CLI\Commands
*/
protected $commands;

Expand All @@ -115,8 +116,8 @@ abstract class BaseCommand
/**
* BaseCommand constructor.
*
* @param \Psr\Log\LoggerInterface $logger
* @param Commands $commands
* @param \Psr\Log\LoggerInterface $logger
* @param \CodeIgniter\CLI\Commands $commands
*/
public function __construct(LoggerInterface $logger, Commands $commands)
{
Expand Down
4 changes: 3 additions & 1 deletion system/CLI/CommandRunner.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


/**
* CodeIgniter
*
Expand Down Expand Up @@ -57,6 +56,9 @@ class CommandRunner extends Controller

//--------------------------------------------------------------------

/**
* Constructor
*/
public function __construct()
{
$this->commands = service('commands');
Expand Down
48 changes: 46 additions & 2 deletions system/CLI/Commands.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,43 @@
<?php namespace CodeIgniter\CLI;
<?php

/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014-2019 British Columbia Institute of Technology
* Copyright (c) 2019-2020 CodeIgniter Foundation
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author CodeIgniter Dev Team
* @copyright 2019-2020 CodeIgniter Foundation
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 4.0.0
* @filesource
*/

namespace CodeIgniter\CLI;

use CodeIgniter\Log\Logger;
use Config\Services;
Expand Down Expand Up @@ -26,9 +65,14 @@ class Commands
*/
protected $logger;

/**
* Constructor
*
* @param \CodeIgniter\Log\Logger|null $logger
*/
public function __construct($logger = null)
{
$this->logger = $logger === null ? service('logger') : $logger;
$this->logger = $logger ?? service('logger');
}

/**
Expand Down
47 changes: 46 additions & 1 deletion system/CLI/Exceptions/CLIException.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,53 @@
<?php namespace CodeIgniter\CLI\Exceptions;
<?php

/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014-2019 British Columbia Institute of Technology
* Copyright (c) 2019-2020 CodeIgniter Foundation
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author CodeIgniter Dev Team
* @copyright 2019-2020 CodeIgniter Foundation
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 4.0.0
* @filesource
*/

namespace CodeIgniter\CLI\Exceptions;

/**
* CLIException
*/
class CLIException extends \RuntimeException
{
/**
* Thrown when `$color` specified for `$type` is not within the
* allowed list of colors.
*
* @param string $type
* @param string $color
*
Expand Down