Browse Source

Fix static analyzer issues found as follow up.

mscherer 6 years ago
parent
commit
ec15384b2d
4 changed files with 6 additions and 8 deletions
  1. 1 1
      src/Console/ConsoleIo.php
  2. 1 1
      src/Console/Shell.php
  3. 2 4
      src/Http/Client.php
  4. 2 2
      src/basics.php

+ 1 - 1
src/Console/ConsoleIo.php

@@ -386,7 +386,7 @@ class ConsoleIo
      * Add a new output style or get defined styles.
      *
      * @param string|null $style The style to get or create.
-     * @param array|bool|null $definition The array definition of the style to change or create a style
+     * @param array|true|null $definition The array definition of the style to change or create a style
      *   or false to remove a style.
      * @return array|null|true If you are getting styles, the style or null will be returned. If you are creating/modifying
      *   styles true will be returned.

+ 1 - 1
src/Console/Shell.php

@@ -623,7 +623,7 @@ class Shell
      * @param string $prompt Prompt text.
      * @param string|array|null $options Array or string of options.
      * @param string|null $default Default input value.
-     * @return mixed Either the default value, or the user-provided input.
+     * @return string|null Either the default value, or the user-provided input.
      * @link https://book.cakephp.org/3.0/en/console-and-shells.html#Shell::in
      */
     public function in(string $prompt, $options = null, ?string $default = null): ?string

+ 2 - 4
src/Http/Client.php

@@ -593,9 +593,8 @@ class Client implements ClientInterface
         $auth = $options['auth'];
         /** @var \Cake\Http\Client\Auth\Basic $adapter */
         $adapter = $this->_createAuth($auth, $options);
-        $result = $adapter->authentication($request, $options['auth']);
 
-        return $result ?: $request;
+        return $adapter->authentication($request, $options['auth']);
     }
 
     /**
@@ -613,9 +612,8 @@ class Client implements ClientInterface
         $auth = $options['proxy'];
         /** @var \Cake\Http\Client\Auth\Basic $adapter */
         $adapter = $this->_createAuth($auth, $options);
-        $result = $adapter->proxyAuthentication($request, $options['proxy']);
 
-        return $result ?: $request;
+        return $adapter->proxyAuthentication($request, $options['proxy']);
     }
 
     /**

+ 2 - 2
src/basics.php

@@ -78,9 +78,9 @@ if (!function_exists('stackTrace')) {
      * - `start` - The stack frame to start generating a trace from. Defaults to 1
      *
      * @param array $options Format for outputting stack trace
-     * @return string|array Formatted stack trace
+     * @return void
      */
-    function stackTrace(array $options = [])
+    function stackTrace(array $options = []): void
     {
         if (!Configure::read('debug')) {
             return;