Skip to content

Add order option to phpdoc_order #6515

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

Merged
merged 1 commit into from
Sep 9, 2022
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
5 changes: 4 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@
],
],
'no_useless_nullsafe_operator' => true,
'phpdoc_separation' => [
'phpdoc_order' => [
'order' => ['param', 'return', 'throws'],
],
'phpdoc_separation' => [
'groups' => [
['immutable', 'psalm-immutable'],
['param', 'phpstan-param', 'psalm-param'],
Expand Down
5 changes: 4 additions & 1 deletion .php-cs-fixer.no-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@
],
],
'no_useless_nullsafe_operator' => true,
'phpdoc_separation' => [
'phpdoc_order' => [
'order' => ['param', 'return', 'throws'],
],
'phpdoc_separation' => [
'groups' => [
['immutable', 'psalm-immutable'],
['param', 'phpstan-param', 'psalm-param'],
Expand Down
5 changes: 4 additions & 1 deletion .php-cs-fixer.user-guide.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@
],
],
'no_useless_nullsafe_operator' => true,
'phpdoc_separation' => [
'phpdoc_order' => [
'order' => ['param', 'return', 'throws'],
],
'phpdoc_separation' => [
'groups' => [
['immutable', 'psalm-immutable'],
['param', 'phpstan-param', 'psalm-param'],
Expand Down
52 changes: 26 additions & 26 deletions system/BaseModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,9 @@ abstract protected function doFind(bool $singleton, $id = null);
*
* @param string $columnName Column Name
*
* @throws DataException
*
* @return array|null The resulting row of data, or null if no data found.
*
* @throws DataException
*/
abstract protected function doFindColumn(string $columnName);

Expand Down Expand Up @@ -392,9 +392,9 @@ abstract protected function doUpdate($id = null, $data = null): bool;
* @param int $batchSize The size of the batch to run
* @param bool $returnSQL True means SQL is returned, false will execute the query
*
* @throws DatabaseException
*
* @return mixed Number of rows affected or FALSE on failure
*
* @throws DatabaseException
*/
abstract protected function doUpdateBatch(?array $set = null, ?string $index = null, int $batchSize = 100, bool $returnSQL = false);

Expand All @@ -405,9 +405,9 @@ abstract protected function doUpdateBatch(?array $set = null, ?string $index = n
* @param array|int|string|null $id The rows primary key(s)
* @param bool $purge Allows overriding the soft deletes setting.
*
* @throws DatabaseException
*
* @return bool|string
*
* @throws DatabaseException
*/
abstract protected function doDelete($id = null, bool $purge = false);

Expand Down Expand Up @@ -541,9 +541,9 @@ public function find($id = null)
*
* @param string $columnName Column Name
*
* @throws DataException
*
* @return array|null The resulting row of data, or null if no data found.
*
* @throws DataException
*/
public function findColumn(string $columnName)
{
Expand Down Expand Up @@ -693,9 +693,9 @@ public function getInsertID()
* @param array|object|null $data Data
* @param bool $returnID Whether insert ID should be returned or not.
*
* @throws ReflectionException
*
* @return bool|int|string insert ID or true on success. false on failure.
*
* @throws ReflectionException
*/
public function insert($data = null, bool $returnID = true)
{
Expand Down Expand Up @@ -767,9 +767,9 @@ public function insert($data = null, bool $returnID = true)
* @param int $batchSize The size of the batch to run
* @param bool $testing True means only number of records is returned, false will execute the query
*
* @throws ReflectionException
*
* @return bool|int Number of rows inserted or FALSE on failure
*
* @throws ReflectionException
*/
public function insertBatch(?array $set = null, ?bool $escape = null, int $batchSize = 100, bool $testing = false)
{
Expand Down Expand Up @@ -882,10 +882,10 @@ public function update($id = null, $data = null): bool
* @param int $batchSize The size of the batch to run
* @param bool $returnSQL True means SQL is returned, false will execute the query
*
* @return mixed Number of rows affected or FALSE on failure
*
* @throws DatabaseException
* @throws ReflectionException
*
* @return mixed Number of rows affected or FALSE on failure
*/
public function updateBatch(?array $set = null, ?string $index = null, int $batchSize = 100, bool $returnSQL = false)
{
Expand Down Expand Up @@ -937,9 +937,9 @@ public function updateBatch(?array $set = null, ?string $index = null, int $batc
* @param array|int|string|null $id The rows primary key(s)
* @param bool $purge Allows overriding the soft deletes setting.
*
* @throws DatabaseException
*
* @return BaseResult|bool
*
* @throws DatabaseException
*/
public function delete($id = null, bool $purge = false)
{
Expand Down Expand Up @@ -1153,9 +1153,9 @@ protected function doProtectFields(array $data): array
*
* @param int|null $userData An optional PHP timestamp to be converted.
*
* @throws ModelException
*
* @return mixed
*
* @throws ModelException
*/
protected function setDate(?int $userData = null)
{
Expand All @@ -1177,9 +1177,9 @@ protected function setDate(?int $userData = null)
*
* @param int $value value
*
* @throws ModelException
*
* @return int|string
*
* @throws ModelException
*/
protected function intToDate(int $value)
{
Expand Down Expand Up @@ -1440,9 +1440,9 @@ public function allowCallbacks(bool $val = true)
* @param string $event Event
* @param array $eventData Event Data
*
* @throws DataException
*
* @return mixed
*
* @throws DataException
*/
protected function trigger(string $event, array $eventData)
{
Expand Down Expand Up @@ -1501,9 +1501,9 @@ public function asObject(string $class = 'object')
* @param bool $onlyChanged Only Changed Property
* @param bool $recursive If true, inner entities will be casted as array as well
*
* @throws ReflectionException
*
* @return array Array
*
* @throws ReflectionException
*/
protected function objectToArray($data, bool $onlyChanged = true, bool $recursive = false): array
{
Expand Down Expand Up @@ -1531,9 +1531,9 @@ protected function objectToArray($data, bool $onlyChanged = true, bool $recursiv
* @param bool $onlyChanged Only Changed Property
* @param bool $recursive If true, inner entities will be casted as array as well
*
* @throws ReflectionException
*
* @return array|null Array
*
* @throws ReflectionException
*/
protected function objectToRawArray($data, bool $onlyChanged = true, bool $recursive = false): ?array
{
Expand Down
4 changes: 2 additions & 2 deletions system/CLI/BaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ abstract public function run(array $params);
/**
* Can be used by a command to run other commands.
*
* @throws ReflectionException
*
* @return mixed
*
* @throws ReflectionException
*/
protected function call(string $command, array $params = [])
{
Expand Down
8 changes: 4 additions & 4 deletions system/CLI/CommandRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ public function __construct()
* @param string $method
* @param array $params
*
* @throws ReflectionException
*
* @return mixed
*
* @throws ReflectionException
*/
public function _remap($method, $params)
{
Expand All @@ -54,9 +54,9 @@ public function _remap($method, $params)
/**
* Default command.
*
* @throws ReflectionException
*
* @return mixed
*
* @throws ReflectionException
*/
public function index(array $params)
{
Expand Down
4 changes: 2 additions & 2 deletions system/CLI/Console.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public function __construct(CodeIgniter $app)
/**
* Runs the current command discovered on the CLI.
*
* @throws Exception
*
* @return mixed
*
* @throws Exception
*/
public function run(bool $useSafeOutput = false)
{
Expand Down
16 changes: 8 additions & 8 deletions system/CodeIgniter.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,9 @@ protected function initializeKint()
* tries to route the response, loads the controller and generally
* makes all of the pieces work together.
*
* @throws RedirectException
*
* @return ResponseInterface|void
*
* @throws RedirectException
*/
public function run(?RouteCollectionInterface $routes = null, bool $returnResponse = false)
{
Expand Down Expand Up @@ -396,10 +396,10 @@ private function isWeb(): bool
/**
* Handles the main request logic and fires the controller.
*
* @return ResponseInterface
*
* @throws PageNotFoundException
* @throws RedirectException
*
* @return ResponseInterface
*/
protected function handleRequest(?RouteCollectionInterface $routes, Cache $cacheConfig, bool $returnResponse = false)
{
Expand Down Expand Up @@ -649,9 +649,9 @@ protected function forceSecureAccess($duration = 31_536_000)
/**
* Determines if a response has been cached for the given URI.
*
* @throws Exception
*
* @return false|ResponseInterface
*
* @throws Exception
*/
public function displayCache(Cache $config)
{
Expand Down Expand Up @@ -754,9 +754,9 @@ public function displayPerformanceMetrics(string $output): string
* @param RouteCollectionInterface|null $routes An collection interface to use in place
* of the config file.
*
* @throws RedirectException
*
* @return string|string[]|null Route filters, that is, the filters specified in the routes file
*
* @throws RedirectException
*/
protected function tryToRouteIt(?RouteCollectionInterface $routes = null)
{
Expand Down
4 changes: 2 additions & 2 deletions system/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,9 +419,9 @@ function env(string $key, $default = null)
* @param array|string $data
* @param string $encoding
*
* @throws InvalidArgumentException
*
* @return array|string
*
* @throws InvalidArgumentException
*/
function esc($data, string $context = 'html', ?string $encoding = null)
{
Expand Down
8 changes: 4 additions & 4 deletions system/Cookie/Cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ public static function setDefaults($config = [])
/**
* Create a new Cookie instance from a `Set-Cookie` header.
*
* @throws CookieException
*
* @return static
*
* @throws CookieException
*/
public static function fromHeaderString(string $cookie, bool $raw = false)
{
Expand Down Expand Up @@ -575,9 +575,9 @@ public function offsetExists($offset): bool
*
* @param mixed $offset
*
* @throws InvalidArgumentException
*
* @return mixed
*
* @throws InvalidArgumentException
*/
#[ReturnTypeWillChange]
public function offsetGet($offset)
Expand Down
4 changes: 2 additions & 2 deletions system/Cookie/CookieStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ class CookieStore implements Countable, IteratorAggregate
*
* @param string[] $headers
*
* @throws CookieException
*
* @return static
*
* @throws CookieException
*/
public static function fromCookieHeaders(array $headers, bool $raw = false)
{
Expand Down
Loading