Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 19ff5e6

Browse files
committed
Repository pattern - some code style changes
1 parent a0c2a7d commit 19ff5e6

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Repository/MemoryStorage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Class MemoryStorage
77
* @package DesignPatterns\Repository
88
*/
9-
class MemoryStorage implements IStorage
9+
class MemoryStorage implements Storage
1010
{
1111

1212
private $data;

Repository/PostRepository.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
/**
66
* Repository for class Post
7-
* This class is between Entity layer(class Post) and access object layer(interface IStorage)
7+
* This class is between Entity layer(class Post) and access object layer(interface Storage)
88
* Repository encapsulates the set of objects persisted in a data store and the operations performed over them, providing a more object-oriented view of the persistence layer
99
* Repository also supports the objective of achieving a clean separation and one-way dependency between the domain and data mapping layers
1010
*
@@ -15,7 +15,7 @@ class PostRepository
1515
{
1616
private $persistence;
1717

18-
public function __construct(IStorage $persistence)
18+
public function __construct(Storage $persistence)
1919
{
2020
$this->persistence = $persistence;
2121
}

Repository/IStorage.php renamed to Repository/Storage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
namespace DesignPatterns\Repository;
44

55
/**
6-
* Interface IStorage
6+
* Interface Storage
77
*
88
* This interface describes methods for accessing storage.
99
* Concrete realization could be whatever we want - in memory, relational database, NoSQL database and etc
1010
*
1111
* @package DesignPatterns\Repository
1212
*/
13-
interface IStorage
13+
interface Storage
1414
{
1515
/**
1616
* Method to persist data

0 commit comments

Comments
 (0)