1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
From 634ba5285ced6c01b0824c5c22baeef17e04d33c Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Sat, 27 May 2017 08:12:19 +0200
Subject: [PATCH 1/3] fix count(): Parameter must be an array or an object that
implements Countable (php 7.2)
---
src/History.php | 2 +-
src/LruArrayCache.php | 9 +++++++--
tests/S3/BatchDeleteTest.php | 2 +-
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/History.php b/src/History.php
index 89e278a72..d9feee8a0 100644
--- a/src/History.php
+++ b/src/History.php
@@ -11,7 +11,7 @@
class History implements \Countable, \IteratorAggregate
{
private $maxEntries;
- private $entries;
+ private $entries = array();
/**
* @param int $maxEntries Maximum number of entries to store.
diff --git a/src/LruArrayCache.php b/src/LruArrayCache.php
index 39ff7fc04..aef2dd537 100644
--- a/src/LruArrayCache.php
+++ b/src/LruArrayCache.php
@@ -11,13 +11,13 @@
* cache, if the number of cached items exceeds the allowed number, the first
* N number of items are removed from the array.
*/
-class LruArrayCache implements CacheInterface
+class LruArrayCache implements CacheInterface, \Countable
{
/** @var int */
private $maxItems;
/** @var array */
- private $items;
+ private $items = array();
/**
* @param int $maxItems Maximum number of allowed cache items.
@@ -71,4 +71,9 @@ public function remove($key)
{
unset($this->items[$key]);
}
+
+ public function count()
+ {
+ return count($this->items);
+ }
}
diff --git a/tests/S3/BatchDeleteTest.php b/tests/S3/BatchDeleteTest.php
index 7934379af..dda2641b5 100644
--- a/tests/S3/BatchDeleteTest.php
+++ b/tests/S3/BatchDeleteTest.php
@@ -206,7 +206,7 @@ public function testWithNoMatchingObjects()
$batch->delete();
$last = $mock->getLastCommand();
$this->assertEquals('ListObjects', $last->getName());
- $this->assertEquals(0, count($last['Delete']['Objects']));
+ $this->assertFalse(isset($last['Delete']['Objects']));
$this->assertEquals('foo', $last['Bucket']);
}
}
From 5dc49b75e05b43fc250d8dd949d583287ce1b2a0 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Sat, 27 May 2017 08:41:21 +0200
Subject: [PATCH 2/3] fix session_set_save_handler(): Cannot change save
handler when headers already sent (php 7.2)
---
tests/DynamoDb/DynamoDbClientTest.php | 1 +
tests/DynamoDb/SessionHandlerTest.php | 1 +
2 files changed, 2 insertions(+)
diff --git a/tests/DynamoDb/DynamoDbClientTest.php b/tests/DynamoDb/DynamoDbClientTest.php
index 1b549921e..1bec6759b 100644
--- a/tests/DynamoDb/DynamoDbClientTest.php
+++ b/tests/DynamoDb/DynamoDbClientTest.php
@@ -12,6 +12,7 @@
/**
* @covers \Aws\DynamoDb\DynamoDbClient
+ * @runTestsInSeparateProcesses
*/
class DynamoDbClientTest extends \PHPUnit_Framework_TestCase
{
diff --git a/tests/DynamoDb/SessionHandlerTest.php b/tests/DynamoDb/SessionHandlerTest.php
index 07915e652..62c4a97a9 100644
--- a/tests/DynamoDb/SessionHandlerTest.php
+++ b/tests/DynamoDb/SessionHandlerTest.php
@@ -6,6 +6,7 @@
/**
* @covers Aws\DynamoDb\SessionHandler
+ * @runTestsInSeparateProcesses
*/
class SessionHandlerTest extends \PHPUnit_Framework_TestCase
{
From 93ba536daac90e15a5c91eb6e7d8507cf4546406 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Sat, 27 May 2017 08:52:22 +0200
Subject: [PATCH 3/3] enable nightly (7.2)
---
.travis.yml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.travis.yml b/.travis.yml
index 4160ad7de..68b0646ac 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,6 +5,7 @@ php:
- 5.6
- 7.0
- 7.1
+ - nightly
- hhvm
sudo: false
@@ -16,6 +17,7 @@ env:
matrix:
allow_failures:
- php: hhvm
+ - php: nightly
fast_finish: true
install:
|