Skip to content

refactor: RequestTrait by rector - #7006

Merged
kenjis merged 1 commit into
codeigniter4:developfrom
kenjis:rector-RequestTrait
Dec 22, 2022
Merged

refactor: RequestTrait by rector#7006
kenjis merged 1 commit into
codeigniter4:developfrom
kenjis:rector-RequestTrait

Conversation

@kenjis

@kenjis kenjis commented Dec 22, 2022

Copy link
Copy Markdown
Member

Description

1 file with changes
===================

1) system/HTTP/RequestTrait.php:63

    ---------- begin diff ----------
@@ @@
          */
         // @phpstan-ignore-next-line
         $proxyIPs = $this->proxyIPs ?? config('App')->proxyIPs;
-        if (! empty($proxyIPs)) {
-            // @phpstan-ignore-next-line
-            if (! is_array($proxyIPs) || is_int(array_key_first($proxyIPs))) {
-                throw new ConfigException(
-                    'You must set an array with Proxy IP address key and HTTP header name value in Config\App::$proxyIPs.'
-                );
-            }
+        // @phpstan-ignore-next-line
+        if (! empty($proxyIPs) && (! is_array($proxyIPs) || is_int(array_key_first($proxyIPs)))) {
+            throw new ConfigException(
+                'You must set an array with Proxy IP address key and HTTP header name value in Config\App::$proxyIPs.'
+            );
         }

         $this->ipAddress = $this->getServer('REMOTE_ADDR');
    ----------- end diff -----------

Applied rules:
 * CombineIfRector

https://github.com/codeigniter4/CodeIgniter4/actions/runs/3755096600/jobs/6379874712

Checklist:

  • Securely signed commits
  • [] Component(s) with PHPDoc blocks, only if necessary or adds value
  • [] Unit testing, with >80% coverage
  • [] User guide updated
  • Conforms to style guide

@kenjis kenjis added the refactor Pull requests that refactor code label Dec 22, 2022
@kenjis
kenjis merged commit c564174 into codeigniter4:develop Dec 22, 2022
@kenjis
kenjis deleted the rector-RequestTrait branch December 22, 2022 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Pull requests that refactor code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants