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

cs-fixer: use new rules #155

Merged
merged 4 commits into from
Sep 22, 2022
Merged

cs-fixer: use new rules #155

merged 4 commits into from
Sep 22, 2022

Conversation

macbre
Copy link
Member

@macbre macbre commented Sep 22, 2022

https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/doc/rules/index.rst

Examples

list_syntax

-                list($type, $callback) = $entry;
+                [$type, $callback] = $entry;

ternary_to_null_coalescing

-        $this->prefix = isset($settings['prefix']) ? $settings['prefix'] : false;
+        $this->prefix = $settings['prefix'] ?? false;

trailing_comma_in_multiline

                 array_merge($column_where, $where),
                 [
                     'order' => $column,
-                    'limit' => intval($batch)
+                    'limit' => intval($batch),
                 ],

> php-cs-fixer fix --config=.php-cs-fixer.php
Loaded config default from ".php-cs-fixer.php".
Using cache file ".php-cs-fixer.cache".
   1) app/config/default.config.php
   2) classes/database/DatabaseMysql.class.php
   3) classes/Cache.class.php
   4) classes/MessageQueue.class.php
   5) classes/cache/CacheRedis.class.php
   6) classes/cache/CacheFile.class.php
   7) classes/NanoScript.class.php
   8) classes/Router.class.php
   9) classes/utils/SitemapGenerator.class.php
  10) classes/utils/HttpClient.class.php
  11) classes/Database.class.php
  12) classes/NanoApp.class.php
  13) classes/Response.class.php
  14) classes/mq/MessageQueueRedis.class.php
  15) classes/Request.class.php
  16) classes/Skin.class.php
  17) classes/Events.class.php
  18) tests/CacheTest.php
  19) tests/app/config/default.config.php
  20) tests/app/controllers/foo/FooController.class.php
  21) tests/RequestTest.php
  22) tests/OutputTest.php
  23) tests/StaticAssetsTest.php

Fixed all files in 1.325 seconds, 14.000 MB memory used
@macbre macbre added the enhancement New feature or request label Sep 22, 2022
@macbre macbre merged commit f595b34 into master Sep 22, 2022
@macbre macbre deleted the cs-fixer/new-rules branch September 22, 2022 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant