-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update traits for iterarable interface
DataContainerDecoratorTrait has been made iterable. DataContainerIteratorAggregateTrait has been made deprecated. The traits can no longer be used at the same time because they conflict with each other.
- Loading branch information
Ashoka de Wit
committed
Sep 3, 2018
1 parent
74e4342
commit 011ca51
Showing
6 changed files
with
108 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
/** | ||
* Copyright MediaCT. All rights reserved. | ||
* https://www.mediact.nl | ||
*/ | ||
|
||
namespace Mediact\DataContainer\Tests\TestDouble; | ||
|
||
use IteratorAggregate; | ||
use Mediact\DataContainer\DataContainer; | ||
use Mediact\DataContainer\DataContainerDecoratorTrait; | ||
use Mediact\DataContainer\DataContainerInterface; | ||
use Mediact\DataContainer\DataContainerIteratorAggregateTrait; | ||
|
||
class IterableImplementationDouble implements IteratorAggregate | ||
{ | ||
use DataContainerIteratorAggregateTrait; | ||
|
||
/** @var DataContainerInterface */ | ||
private $storage; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param DataContainerInterface $storage | ||
*/ | ||
public function __construct(DataContainerInterface $storage) | ||
{ | ||
$this->storage = $storage; | ||
} | ||
|
||
/** | ||
* Get the storage. | ||
* | ||
* @return DataContainerInterface | ||
*/ | ||
protected function getStorage(): DataContainerInterface | ||
{ | ||
return $this->storage; | ||
} | ||
} |