Skip to content

Commit 81118e1

Browse files
committed
Update
1 parent cc51742 commit 81118e1

2 files changed

Lines changed: 4 additions & 15 deletions

File tree

src/Contracts/DataObject.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
/**
66
* Interface DataObject
77
*
8-
* DataObject defines the basic interface to work as a data container for Repositories.
9-
* It must be filled by an Array and cast to Array, it's also needs a unique id.
10-
* @package Saedyousef\Contracts
8+
* DataObject defines the basic interface to work as a data container.
9+
* It should be filled by an Array and cast to Array, it's also needs a unique id.
1110
*/
1211
interface DataObject extends Identifiable, Hydrable, Arrayable
1312
{

src/Contracts/Hydrable.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,13 @@
22

33
namespace SY\DataObject\Contracts;
44

5-
/**
6-
* Interface Hydrable
7-
*
8-
* This marks objects that can be filled by an array. This is mainly used for
9-
* ORM or Data Object, which have to be filled by a Repository.
10-
*
11-
* @package Saedyousef\SupremeObject\Contracts
12-
*/
135
interface Hydrable
146
{
157

168
/**
17-
* Hydrate the object by the $data. Completely clears the object, and refill it.
9+
* Clear the data and refill the object.
1810
*
1911
* @param array $data
20-
*
2112
* @return void
2213
*/
2314
public function hydrate(array $data);
@@ -26,8 +17,7 @@ public function hydrate(array $data);
2617
* Fill the object by the array. Don't clear the object before filling it.
2718
*
2819
* @param array $data
29-
*
3020
* @return self
3121
*/
32-
public function apply(array $data);
22+
public function apply(array $data): Hydrable;
3323
}

0 commit comments

Comments
 (0)