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

Remove useless code separator comments #4946

Merged
merged 1 commit into from
Jul 19, 2021
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
4 changes: 0 additions & 4 deletions app/Config/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ class Database extends Config
'port' => 3306,
];

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

public function __construct()
{
parent::__construct();
Expand All @@ -89,6 +87,4 @@ public function __construct()
$this->defaultGroup = 'tests';
}
}

//--------------------------------------------------------------------
}
2 changes: 0 additions & 2 deletions app/Config/Format.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ class Format extends BaseConfig
'text/xml' => 0,
];

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

/**
* A Factory method to return the appropriate formatter for the given mime type.
*
Expand Down
3 changes: 1 addition & 2 deletions app/Controllers/BaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ public function initController(RequestInterface $request, ResponseInterface $res
// Do Not Edit This Line
parent::initController($request, $response, $logger);

//--------------------------------------------------------------------
// Preload any models, libraries, etc, here.
//--------------------------------------------------------------------

// E.g.: $this->session = \Config\Services::session();
}
}
12 changes: 1 addition & 11 deletions app/Views/errors/html/debug.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
//--------------------------------------------------------------------
// Tabs
//--------------------------------------------------------------------

var tabLinks = new Array();
var contentDivs = new Array();
Expand Down Expand Up @@ -52,8 +50,6 @@ function init()
}
}

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

function showTab()
{
var selectedId = getHash(this.getAttribute('href'));
Expand All @@ -78,8 +74,6 @@ function showTab()
return false;
}

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

function getFirstChildWithTagName(element, tagName)
{
for (var i = 0; i < element.childNodes.length; i ++)
Expand All @@ -91,16 +85,12 @@ function getFirstChildWithTagName(element, tagName)
}
}

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

function getHash(url)
{
var hashPos = url.lastIndexOf('#');
return url.substring(hashPos + 1);
}

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

function toggle(elem)
{
elem = document.getElementById(elem);
Expand All @@ -125,4 +115,4 @@ function toggle(elem)
elem.style.display = disp == 'block' ? 'none' : 'block';

return false;
}
}
71 changes: 24 additions & 47 deletions contributing/styleguide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -266,61 +266,38 @@ An example::

<?php

/**
* CodeIgniter
*
* An open source application development framework for PHP
*
...
*
* @package CodeIgniter
* @author CodeIgniter Dev Team
* @copyright 2014-2019 British Columbia Institute of Technology (https://bcit.ca/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 4.0.0
* @filesource
*/
namespace CodeIgniter\Fruit;

use CodeIgniter\Config\BaseConfig;

/**
* Base class for entities in the CodeIgniter\Fruit module.
*
* @property $group
* @property $name
* @property $description
*
* @package CodeIgniter\Fruit
*/
abstract class BaseFruit
{

/**
* The group a fruit belongs to.
*
* @var string
*/
protected $group;

/**
* Fruit constructor.
*
* @param BaseConfig $config
*/
public function __construct(BaseConfig $Config)
{
$this->group = 'Unknown';
}

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

/**
* Model a fruit ripening over time.
*
* @param array $params
*/
abstract public function ripen(array $params);
/**
* The group a fruit belongs to.
*
* @var string
*/
protected $group;

/**
* Fruit constructor.
*
* @param BaseConfig $config
*/
public function __construct(BaseConfig $Config)
{
$this->group = 'Unknown';
}

/**
* Model a fruit ripening over time.
*
* @param array $params
*/
abstract public function ripen(array $params);
}

Other
Expand Down
25 changes: 0 additions & 25 deletions system/API/ResponseTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ trait ResponseTrait
*/
protected $formatter;

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

/**
* Provides a single, simple method to return an API response, formatted
* to match the requested format, with proper content-type and status code.
Expand Down Expand Up @@ -123,8 +121,6 @@ public function respond($data = null, ?int $status = null, string $message = '')
return $this->response->setBody($output)->setStatusCode($status, $message);
}

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

/**
* Used for generic failures that no custom methods exist for.
*
Expand All @@ -150,7 +146,6 @@ public function fail($messages, int $status = 400, ?string $code = null, string
return $this->respond($response, $status, $customMessage);
}

//--------------------------------------------------------------------
//--------------------------------------------------------------------
// Response Helpers
//--------------------------------------------------------------------
Expand All @@ -168,8 +163,6 @@ public function respondCreated($data = null, string $message = '')
return $this->respond($data, $this->codes['created'], $message);
}

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

/**
* Used after a resource has been successfully deleted.
*
Expand All @@ -196,8 +189,6 @@ public function respondUpdated($data = null, string $message = '')
return $this->respond($data, $this->codes['updated'], $message);
}

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

/**
* Used after a command has been successfully executed but there is no
* meaningful reply to send back to the client.
Expand All @@ -211,8 +202,6 @@ public function respondNoContent(string $message = 'No Content')
return $this->respond(null, $this->codes['no_content'], $message);
}

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

/**
* Used when the client is either didn't send authorization information,
* or had bad authorization credentials. User is encouraged to try again
Expand All @@ -229,8 +218,6 @@ public function failUnauthorized(string $description = 'Unauthorized', ?string $
return $this->fail($description, $this->codes['unauthorized'], $code, $message);
}

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

/**
* Used when access is always denied to this resource and no amount
* of trying again will help.
Expand All @@ -246,8 +233,6 @@ public function failForbidden(string $description = 'Forbidden', ?string $code =
return $this->fail($description, $this->codes['forbidden'], $code, $message);
}

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

/**
* Used when a specified resource cannot be found.
*
Expand All @@ -262,8 +247,6 @@ public function failNotFound(string $description = 'Not Found', ?string $code =
return $this->fail($description, $this->codes['resource_not_found'], $code, $message);
}

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

/**
* Used when the data provided by the client cannot be validated.
*
Expand Down Expand Up @@ -294,8 +277,6 @@ public function failValidationErrors($errors, ?string $code = null, string $mess
return $this->fail($errors, $this->codes['invalid_data'], $code, $message);
}

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

/**
* Use when trying to create a new resource and it already exists.
*
Expand All @@ -310,8 +291,6 @@ public function failResourceExists(string $description = 'Conflict', ?string $co
return $this->fail($description, $this->codes['resource_exists'], $code, $message);
}

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

/**
* Use when a resource was previously deleted. This is different than
* Not Found, because here we know the data previously existed, but is now gone,
Expand All @@ -328,8 +307,6 @@ public function failResourceGone(string $description = 'Gone', ?string $code = n
return $this->fail($description, $this->codes['resource_gone'], $code, $message);
}

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

/**
* Used when the user has made too many requests for the resource recently.
*
Expand All @@ -344,8 +321,6 @@ public function failTooManyRequests(string $description = 'Too Many Requests', ?
return $this->fail($description, $this->codes['too_many_requests'], $code, $message);
}

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

/**
* Used when there is a server error.
*
Expand Down
Loading