Skip to content

Commit 5406e73

Browse files
committed
Merge pull request #13 from Taluu/hhvm
PHP 5.6 & HHVM
2 parents 3c6f3d6 + 14a416d commit 5406e73

4 files changed

Lines changed: 13 additions & 7 deletions

File tree

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ language: php
33
php:
44
- 5.4
55
- 5.5
6+
- 5.6
7+
- hhvm
8+
9+
matrix:
10+
allow_failures:
11+
- php: hhvm
612

713
before_script:
814
- composer self-update

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Totem
1414
|.)(.|
1515
| || |
1616
\(__)/ Changeset calculator between two state of a data
17-
|-..-| Requires PHP 5.4 ; Compatible PHP 5.5
17+
|-..-| Requires PHP 5.4 ; Compatible PHP 5.5, PHP 5.6, and HHVM
1818
|o\/o|
1919
.----\ /----.
2020
/ / / |~~~~| \ \ \

src/AbstractSnapshot.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ abstract class AbstractSnapshot implements ArrayAccess
3636
/**
3737
* Calculate the diff between two snapshots
3838
*
39-
* @param self $snapshot Snapshot to compare this one to
39+
* @param AbstractSnapshot $snapshot Snapshot to compare this one to
4040
*
4141
* @return Set Changeset between the two snapshots
4242
* @throws IncomparableDataException If the two snapshots are not comparable
4343
*/
44-
public function diff(self $snapshot)
44+
public function diff(AbstractSnapshot $snapshot)
4545
{
4646
if (!$this->isComparable($snapshot)) {
4747
throw new IncomparableDataException;
@@ -130,11 +130,11 @@ final public function offsetUnset($offset)
130130
/**
131131
* Check if the two snapshots are comparable
132132
*
133-
* @param self $snapshot Snapshot to be compared with
133+
* @param AbstractSnapshot $snapshot Snapshot to be compared with
134134
*
135135
* @return boolean true if the two snapshots can be processed in a diff, false otherwise
136136
*/
137-
public function isComparable(self $snapshot)
137+
public function isComparable(AbstractSnapshot $snapshot)
138138
{
139139
if (!$snapshot instanceof static) {
140140
return false;

src/Snapshot/ObjectSnapshot.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ class ObjectSnapshot extends AbstractSnapshot
3737
public function __construct($object)
3838
{
3939
if (!is_object($object)) {
40-
throw new InvalidArgumentException('This is not an object');
40+
throw new InvalidArgumentException(sprintf('Object expected, had "%s"', gettype($object)));
4141
}
4242

4343
$this->raw = $object;
4444
$this->oid = spl_object_hash($object);
4545
$refl = new ReflectionObject($object);
4646

47-
if ($refl->isCloneable()) {
47+
if (method_exists('\\ReflectionObject', 'isCloneable') && $refl->isCloneable()) {
4848
$this->raw = clone $object;
4949
}
5050

0 commit comments

Comments
 (0)