Kaynağa Gözat

Fix of DynamoDbClient::formatAttributes

Looks like formatAttributes() was removed before v3,
so switching to method existence check instead of version check
Victor Pryazhnikov 4 yıl önce
ebeveyn
işleme
c7a5ecca6c

+ 3 - 3
tests/Monolog/Handler/DynamoDbHandlerTest.php

@@ -29,10 +29,10 @@ class DynamoDbHandlerTest extends TestCase
 
 
         $implementedMethods = ['__call'];
         $implementedMethods = ['__call'];
         $absentMethods = [];
         $absentMethods = [];
-        if ($this->isV3) {
-            $absentMethods[] = 'formatAttributes';
-        } else {
+        if (method_exists('Aws\DynamoDb\DynamoDbClient', 'formatAttributes')) {
             $implementedMethods[] = 'formatAttributes';
             $implementedMethods[] = 'formatAttributes';
+        } else {
+            $absentMethods[] = 'formatAttributes';
         }
         }
 
 
         $this->client = $this->getMockBuilder('Aws\DynamoDb\DynamoDbClient')
         $this->client = $this->getMockBuilder('Aws\DynamoDb\DynamoDbClient')