Skip to content

Commit 071d065

Browse files
committed
Release 1.2.1
2 parents 9273ae6 + 0e04c56 commit 071d065

8 files changed

Lines changed: 35 additions & 34 deletions

File tree

README.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,30 @@ Totem
33
[![Build Status](https://travis-ci.org/Taluu/Totem.png?branch=develop)](https://travis-ci.org/Taluu/Totem)
44
[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/Taluu/Totem/badges/quality-score.png?s=b71f67e353a379e19b651697285ffed18d6f1554)](https://scrutinizer-ci.com/g/Taluu/Totem/)
55
[![Code Coverage](https://scrutinizer-ci.com/g/Taluu/Totem/badges/coverage.png?s=526dc791403caf731f6abb78d713291c68cf8446)](https://scrutinizer-ci.com/g/Taluu/Totem/)
6+
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/5d97b609-b57c-467e-9a6e-3a39e08bd825/mini.png)](https://insight.sensiolabs.com/projects/5d97b609-b57c-467e-9a6e-3a39e08bd825)
67

7-
Changeset calculator between two state of a data.
8-
9-
Compatible PHP >= 5.4
10-
11-
Snapshots currently supported :
12-
- Object
13-
- Array
14-
15-
Everything happens on the develop branch ; the master branch is for hotfixes or
16-
releases only !
8+
```
9+
\\\\////
10+
|.)(.|
11+
| || |
12+
\(__)/ Changeset calculator between two state of a data
13+
|-..-| Requires PHP 5.4 ; Compatible PHP 5.5
14+
|o\/o|
15+
.----\ /----.
16+
/ / / |~~~~| \ \ \
17+
/ / / /|::::|\ \ \ \
18+
'-'-'-'-|::::|-'-'-'-'
19+
(((^^)))
20+
>>><<< Snapshots currently natively supported :
21+
|||||| - Object
22+
(o)(o) - Array
23+
| /\ |
24+
(====) Everything happens on the develop branch ; the master branch
25+
|_/\_| is for releases or hotfixes only !
26+
(_/\_)
27+
_|_,__|
28+
(___\___)
29+
```
1730

1831
Documentation
1932
=============

phpunit.xml

100755100644
File mode changed.

src/Totem/AbstractChange.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111

1212
namespace Totem;
1313

14-
use \ArrayAccess,
15-
\BadMethodCallException,
16-
\InvalidArgumentException;
17-
1814
/**
1915
* Base class for a Change
2016
*

src/Totem/AbstractSnapshot.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@
1111

1212
namespace Totem;
1313

14-
use \ArrayAccess,
15-
\ArrayIterator,
16-
\IteratorAggregate,
14+
use \ArrayAccess;
1715

18-
\BadMethodCallException,
16+
use \BadMethodCallException,
1917
\InvalidArgumentException;
2018

2119
use Totem\Exception\IncomparableDataException;
@@ -131,6 +129,7 @@ final public function offsetUnset($offset)
131129
* Check if the two snapshots are comparable
132130
*
133131
* @param self $snapshot Snapshot to be compared with
132+
*
134133
* @return boolean true if the two snapshots can be processed in a diff, false otherwise
135134
*/
136135
public function isComparable(self $snapshot)

src/Totem/Set.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,16 @@
1313

1414
use \Countable,
1515
\ArrayAccess,
16-
\ArrayIterator,
17-
\IteratorAggregate,
1816

1917
\OutOfBoundsException,
2018
\BadMethodCallException,
2119
\InvalidArgumentException;
2220

23-
use Totem\AbstractSnapshot,
24-
Totem\Exception\IncomparableDataException,
25-
26-
Totem\Change\Removal,
21+
use Totem\Change\Removal,
2722
Totem\Change\Addition,
2823
Totem\Change\Modification,
2924

25+
Totem\AbstractSnapshot,
3026
Totem\Snapshot\ArraySnapshot,
3127
Totem\Snapshot\ObjectSnapshot;
3228

@@ -50,7 +46,7 @@ public function __construct(AbstractSnapshot $old, AbstractSnapshot $new)
5046
/**
5147
* Retrieve a property change
5248
*
53-
* @param string $property
49+
* @param string $property
5450
*
5551
* @return AbstractChange Set if it is a recursive change,
5652
* Addition if something was added,
@@ -71,7 +67,7 @@ public function getChange($property)
7167
/**
7268
* Test if the given property has been changed
7369
*
74-
* @param string $property
70+
* @param string $property
7571
*
7672
* @return boolean
7773
*/

src/Totem/Snapshot/ArraySnapshot.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111

1212
namespace Totem\Snapshot;
1313

14-
use \ReflectionObject,
15-
\ReflectionProperty,
16-
17-
\InvalidArgumentException;
18-
1914
use Totem\AbstractSnapshot;
2015

2116
/**

src/Totem/Snapshot/ObjectSnapshot.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Totem\Snapshot;
1313

1414
use \ReflectionObject,
15-
\ReflectionProperty,
1615

1716
\InvalidArgumentException;
1817

@@ -29,9 +28,10 @@ class ObjectSnapshot extends AbstractSnapshot
2928
protected $oid;
3029

3130
/**
32-
* Build this snapshot
31+
* Build this snapshot.
3332
*
3433
* @param object $object Object to fix at the current moment
34+
*
3535
* @throws InvalidArgumentException If this is not an object
3636
*/
3737
public function __construct($object)
@@ -48,6 +48,7 @@ public function __construct($object)
4848
$this->raw = clone $object;
4949
}
5050

51+
/** @var \ReflectionProperty $reflProperty */
5152
foreach ($refl->getProperties() as $reflProperty) {
5253
$reflProperty->setAccessible(true);
5354
$value = $reflProperty->getValue($object);

test/Totem/Snapshot.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515

1616
class Snapshot extends AbstractSnapshot
1717
{
18-
public function __construct(array $args = []) {
18+
public function __construct(array $args = [])
19+
{
1920
$this->raw = isset($args['raw']) ? $args['raw'] : null;
2021
$this->data = isset($args['data']) ? $args['data'] : [];
2122
$this->comparable = isset($args['comparable']) ? true === $args['comparable'] : null;

0 commit comments

Comments
 (0)