Browse Source

Merge branch 'master' into 4.next

Mark Story 5 years ago
parent
commit
da2a7f5a8a

+ 1 - 1
src/I18n/Number.php

@@ -168,7 +168,7 @@ class Number
         $formatter = static::formatter($options);
         $options += ['before' => '', 'after' => ''];
 
-        return $options['before'] . $formatter->format($value) . $options['after'];
+        return $options['before'] . $formatter->format((float)$value) . $options['after'];
     }
 
     /**

+ 1 - 1
src/I18n/RelativeTimeFormatter.php

@@ -294,7 +294,7 @@ class RelativeTimeFormatter implements DifferenceFormatterInterface
 
         $fNum = str_replace(
             ['year', 'month', 'week', 'day', 'hour', 'minute', 'second'],
-            [1, 2, 3, 4, 5, 6, 7],
+            ['1', '2', '3', '4', '5', '6', '7'],
             $fWord
         );
 

+ 3 - 3
src/Mailer/Message.php

@@ -881,14 +881,14 @@ class Message implements JsonSerializable, Serializable
         ];
         foreach ($relation as $var => $header) {
             if ($include[$var]) {
-                $headers[$header] = current($this->formatAddress($this->{$var}));
+                $headers[$header] = (string)current($this->formatAddress($this->{$var}));
             }
         }
         if ($include['sender']) {
             if (key($this->sender) === key($this->from)) {
                 $headers['Sender'] = '';
             } else {
-                $headers['Sender'] = current($this->formatAddress($this->sender));
+                $headers['Sender'] = (string)current($this->formatAddress($this->sender));
             }
         }
 
@@ -911,7 +911,7 @@ class Message implements JsonSerializable, Serializable
         }
 
         if ($this->priority) {
-            $headers['X-Priority'] = $this->priority;
+            $headers['X-Priority'] = (string)$this->priority;
         }
 
         if ($include['subject']) {

+ 1 - 1
src/Routing/Middleware/AssetMiddleware.php

@@ -125,7 +125,7 @@ class AssetMiddleware implements MiddlewareInterface
             }
             $pluginPart[] = Inflector::camelize($parts[$i]);
             $plugin = implode('/', $pluginPart);
-            if ($plugin && Plugin::isLoaded($plugin)) {
+            if (Plugin::isLoaded($plugin)) {
                 $parts = array_slice($parts, $i + 1);
                 $fileFragment = implode(DIRECTORY_SEPARATOR, $parts);
                 $pluginWebroot = Plugin::path($plugin) . 'webroot' . DIRECTORY_SEPARATOR;

+ 1 - 1
tests/TestCase/Command/SchemaCacheCommandsTest.php

@@ -25,7 +25,7 @@ use Cake\TestSuite\ConsoleIntegrationTestTrait;
 use Cake\TestSuite\TestCase;
 
 /**
- * SchemacacheCommands test.
+ * SchemaCacheCommands test.
  */
 class SchemaCacheCommandsTest extends TestCase
 {

+ 1 - 1
tests/TestCase/Http/Middleware/EncryptedCookieMiddlewareTest.php

@@ -34,7 +34,7 @@ class EncryptedCookieMiddlewareTest extends TestCase
 
     protected $middleware;
 
-    protected function _getCookieEncryptionKey()
+    protected function _getCookieEncryptionKey(): string
     {
         return 'super secret key that no one can guess';
     }

+ 1 - 1
tests/TestCase/Mailer/EmailTest.php

@@ -146,7 +146,7 @@ class EmailTest extends TestCase
         $this->assertSame($expected, $this->Email->getSender());
 
         $headers = $this->Email->getHeaders(['from' => true, 'sender' => true]);
-        $this->assertFalse($headers['From']);
+        $this->assertSame('', $headers['From']);
         $this->assertSame('Name <cake@cakephp.org>', $headers['Sender']);
 
         $this->Email->setFrom('cake@cakephp.org', 'CakePHP');

+ 1 - 1
tests/TestCase/Mailer/MessageTest.php

@@ -410,7 +410,7 @@ HTML;
         $this->assertSame($expected, $this->message->getSender());
 
         $headers = $this->message->getHeaders(['from' => true, 'sender' => true]);
-        $this->assertFalse($headers['From']);
+        $this->assertSame('', $headers['From']);
         $this->assertSame('Name <cake@cakephp.org>', $headers['Sender']);
 
         $this->message->setFrom('cake@cakephp.org', 'CakePHP');