Skip to content

Commit e08d548

Browse files
authored
Merge pull request #4964 from paulbalandan/manual-cleanup
Manual cleanup of docblocks and comments
2 parents bd37870 + 31bfbba commit e08d548

88 files changed

Lines changed: 362 additions & 1847 deletions

File tree

Some content is hidden

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

admin/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ if [ "$FILES" != "" ]; then
6969
php ./vendor/bin/php-cs-fixer fix --verbose --dry-run --using-cache=no --diff
7070
fi
7171

72-
if [ $? != 0]; then
72+
if [ $? != 0 ]; then
7373
echo "Files in system, tests, utils, or root are not following the coding standards. Please fix them before commit."
7474
exit 1
7575
fi

phpstan.neon.dist

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,13 @@ parameters:
3232
- '#Access to an undefined property CodeIgniter\\Database\\Forge::\$dropConstraintStr#'
3333
- '#Access to an undefined property CodeIgniter\\Database\\BaseConnection::\$mysqli|\$schema#'
3434
- '#Access to an undefined property CodeIgniter\\Database\\ConnectionInterface::(\$DBDriver|\$connID|\$likeEscapeStr|\$likeEscapeChar|\$escapeChar|\$protectIdentifiers|\$schema)#'
35-
- '#Access to protected property CodeIgniter\\Database\\BaseConnection::(\$DBDebug|\$DBPrefix|\$swapPre|\$charset|\$DBCollat|\$database)#'
3635
- '#Call to an undefined method CodeIgniter\\Database\\BaseConnection::_(disable|enable)ForeignKeyChecks\(\)#'
37-
- '#Call to an undefined method CodeIgniter\\Database\\BaseConnection::supportsForeignKeys\(\)#'
3836
- '#Call to an undefined method CodeIgniter\\Router\\RouteCollectionInterface::(getDefaultNamespace|isFiltered|getFilterForRoute|getRoutesOptions)\(\)#'
3937
- '#Cannot access property [\$a-z_]+ on ((bool\|)?object\|resource)#'
4038
- '#Cannot call method [a-zA-Z_]+\(\) on ((bool\|)?object\|resource)#'
4139
- '#Method CodeIgniter\\Router\\RouteCollectionInterface::getRoutes\(\) invoked with 1 parameter, 0 required#'
4240
- '#Method CodeIgniter\\Validation\\ValidationInterface::run\(\) invoked with 3 parameters, 0-2 required#'
4341
- '#Negated boolean expression is always (true|false)#'
44-
- '#Parameter \#1 \$db of class CodeIgniter\\Database\\SQLite3\\Table constructor expects CodeIgniter\\Database\\SQLite3\\Connection, CodeIgniter\\Database\\BaseConnection given#'
4542
- '#Return type \(bool\) of method CodeIgniter\\HTTP\\Files\\UploadedFile::move\(\) should be compatible with return type \(CodeIgniter\\Files\\File\) of method CodeIgniter\\Files\\File::move\(\)#'
4643
parallel:
4744
processTimeout: 300.0

system/API/ResponseTrait.php

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
use Config\Services;
1818

1919
/**
20-
* Response trait.
21-
*
2220
* Provides common, more readable, methods to provide
2321
* consistent HTTP responses under a variety of common
2422
* situations when working as an API.
@@ -32,7 +30,7 @@ trait ResponseTrait
3230
* Allows child classes to override the
3331
* status code that is used in their API.
3432
*
35-
* @var array
33+
* @var array<string, int>
3634
*/
3735
protected $codes = [
3836
'created' => 201,
@@ -86,21 +84,15 @@ trait ResponseTrait
8684
* to match the requested format, with proper content-type and status code.
8785
*
8886
* @param array|string|null $data
89-
* @param int $status
9087
*
9188
* @return mixed
9289
*/
9390
public function respond($data = null, ?int $status = null, string $message = '')
9491
{
95-
// If data is null and status code not provided, exit and bail
9692
if ($data === null && $status === null) {
9793
$status = 404;
98-
99-
// Create the output var here in case of $this->response([]);
10094
$output = null;
101-
}
102-
// If data is null but status provided, keep the output empty.
103-
elseif ($data === null && is_numeric($status)) {
95+
} elseif ($data === null && is_numeric($status)) {
10496
$output = null;
10597
} else {
10698
$status = empty($status) ? 200 : $status;
@@ -151,8 +143,7 @@ public function fail($messages, int $status = 400, ?string $code = null, string
151143
/**
152144
* Used after successfully creating a new resource.
153145
*
154-
* @param mixed $data Data.
155-
* @param string $message Message.
146+
* @param mixed $data
156147
*
157148
* @return mixed
158149
*/
@@ -164,8 +155,7 @@ public function respondCreated($data = null, string $message = '')
164155
/**
165156
* Used after a resource has been successfully deleted.
166157
*
167-
* @param mixed $data Data.
168-
* @param string $message Message.
158+
* @param mixed $data
169159
*
170160
* @return mixed
171161
*/
@@ -177,8 +167,7 @@ public function respondDeleted($data = null, string $message = '')
177167
/**
178168
* Used after a resource has been successfully updated.
179169
*
180-
* @param mixed $data Data.
181-
* @param string $message Message.
170+
* @param mixed $data
182171
*
183172
* @return mixed
184173
*/
@@ -191,8 +180,6 @@ public function respondUpdated($data = null, string $message = '')
191180
* Used after a command has been successfully executed but there is no
192181
* meaningful reply to send back to the client.
193182
*
194-
* @param string $message Message.
195-
*
196183
* @return mixed
197184
*/
198185
public function respondNoContent(string $message = 'No Content')
@@ -205,8 +192,6 @@ public function respondNoContent(string $message = 'No Content')
205192
* or had bad authorization credentials. User is encouraged to try again
206193
* with the proper information.
207194
*
208-
* @param string $code
209-
*
210195
* @return mixed
211196
*/
212197
public function failUnauthorized(string $description = 'Unauthorized', ?string $code = null, string $message = '')
@@ -218,8 +203,6 @@ public function failUnauthorized(string $description = 'Unauthorized', ?string $
218203
* Used when access is always denied to this resource and no amount
219204
* of trying again will help.
220205
*
221-
* @param string $code
222-
*
223206
* @return mixed
224207
*/
225208
public function failForbidden(string $description = 'Forbidden', ?string $code = null, string $message = '')
@@ -230,8 +213,6 @@ public function failForbidden(string $description = 'Forbidden', ?string $code =
230213
/**
231214
* Used when a specified resource cannot be found.
232215
*
233-
* @param string $code
234-
*
235216
* @return mixed
236217
*/
237218
public function failNotFound(string $description = 'Not Found', ?string $code = null, string $message = '')
@@ -242,8 +223,6 @@ public function failNotFound(string $description = 'Not Found', ?string $code =
242223
/**
243224
* Used when the data provided by the client cannot be validated.
244225
*
245-
* @param string $code
246-
*
247226
* @return mixed
248227
*
249228
* @deprecated Use failValidationErrors instead
@@ -268,8 +247,6 @@ public function failValidationErrors($errors, ?string $code = null, string $mess
268247
/**
269248
* Use when trying to create a new resource and it already exists.
270249
*
271-
* @param string $code
272-
*
273250
* @return mixed
274251
*/
275252
public function failResourceExists(string $description = 'Conflict', ?string $code = null, string $message = '')
@@ -282,8 +259,6 @@ public function failResourceExists(string $description = 'Conflict', ?string $co
282259
* Not Found, because here we know the data previously existed, but is now gone,
283260
* where Not Found means we simply cannot find any information about it.
284261
*
285-
* @param string $code
286-
*
287262
* @return mixed
288263
*/
289264
public function failResourceGone(string $description = 'Gone', ?string $code = null, string $message = '')
@@ -294,8 +269,6 @@ public function failResourceGone(string $description = 'Gone', ?string $code = n
294269
/**
295270
* Used when the user has made too many requests for the resource recently.
296271
*
297-
* @param string $code
298-
*
299272
* @return mixed
300273
*/
301274
public function failTooManyRequests(string $description = 'Too Many Requests', ?string $code = null, string $message = '')
@@ -371,8 +344,6 @@ protected function format($data = null)
371344
/**
372345
* Sets the format the response should be in.
373346
*
374-
* @param string $format
375-
*
376347
* @return $this
377348
*/
378349
public function setResponseFormat(?string $format = null)

system/Autoloader/Autoloader.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
use InvalidArgumentException;
1818

1919
/**
20-
* CodeIgniter Autoloader
21-
*
2220
* An autoloader that uses both PSR4 autoloading, and traditional classmaps.
2321
*
2422
* Given a foo-bar package of classes in the file system at the following paths:
@@ -296,8 +294,6 @@ public function sanitizeFilename(string $filename): string
296294

297295
/**
298296
* Locates autoload information from Composer, if available.
299-
*
300-
* @return void
301297
*/
302298
protected function discoverComposerNamespaces()
303299
{

system/Autoloader/FileLocator.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
namespace CodeIgniter\Autoloader;
1313

1414
/**
15-
* Class FileLocator
16-
*
1715
* Allows loading non-class files in a namespaced manner.
1816
* Works with Helpers, Views, etc.
1917
*/
@@ -26,9 +24,6 @@ class FileLocator
2624
*/
2725
protected $autoloader;
2826

29-
/**
30-
* Constructor
31-
*/
3227
public function __construct(Autoloader $autoloader)
3328
{
3429
$this->autoloader = $autoloader;

system/BaseModel.php

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
use stdClass;
3030

3131
/**
32-
* Class Model
33-
*
3432
* The BaseModel class provides a number of convenient features that
3533
* makes working with a databases less painful. Extending this class
3634
* provide means of implementing various database systems
@@ -288,11 +286,6 @@ abstract class BaseModel
288286
*/
289287
protected $afterDelete = [];
290288

291-
/**
292-
* BaseModel constructor.
293-
*
294-
* @param ValidationInterface|null $validation Validation
295-
*/
296289
public function __construct(?ValidationInterface $validation = null)
297290
{
298291
$this->tempReturnType = $this->returnType;
@@ -431,8 +424,6 @@ abstract protected function doPurgeDeleted();
431424
* Works with the find* methods to return only the rows that
432425
* have been deleted.
433426
* This methods works only with dbCalls
434-
*
435-
* @return void
436427
*/
437428
abstract protected function doOnlyDeleted();
438429

@@ -500,8 +491,6 @@ abstract public function countAllResults(bool $reset = true, bool $test = false)
500491
* @param Closure $userFunc Callback Function
501492
*
502493
* @throws DataException
503-
*
504-
* @return void
505494
*/
506495
abstract public function chunk(int $size, Closure $userFunc);
507496

@@ -829,8 +818,8 @@ public function insertBatch(?array $set = null, ?bool $escape = null, int $batch
829818
* Updates a single record in the database. If an object is provided,
830819
* it will attempt to convert it into an array.
831820
*
832-
* @param array|int|string|null $id ID
833-
* @param array|object|null $data Data
821+
* @param array|int|string|null $id
822+
* @param array|object|null $data
834823
*
835824
* @throws ReflectionException
836825
*/
@@ -987,7 +976,7 @@ public function delete($id = null, bool $purge = false)
987976
* Permanently deletes all rows that have been marked as deleted
988977
* through soft deletes (deleted = 1)
989978
*
990-
* @return bool|mixed
979+
* @return mixed
991980
*/
992981
public function purgeDeleted()
993982
{

system/CLI/BaseCommand.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ abstract class BaseCommand
8787
*/
8888
protected $commands;
8989

90-
/**
91-
* BaseCommand constructor.
92-
*/
9390
public function __construct(LoggerInterface $logger, Commands $commands)
9491
{
9592
$this->logger = $logger;
@@ -98,7 +95,8 @@ public function __construct(LoggerInterface $logger, Commands $commands)
9895

9996
/**
10097
* Actually execute a command.
101-
* This has to be over-ridden in any concrete implementation.
98+
*
99+
* @param array<string, mixed> $params
102100
*/
103101
abstract public function run(array $params);
104102

0 commit comments

Comments
 (0)