Skip to content

Commit a5731eb

Browse files
author
Mauro Cassani
committed
Fixing code (Sensiolabs)
1 parent c2dade3 commit a5731eb

14 files changed

+68
-218
lines changed

composer.lock

+8-158
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/InMemoryList/Application/Client.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212

1313
use InMemoryList\Application\Exceptions\MalformedParametersException;
1414
use InMemoryList\Application\Exceptions\NotSupportedDriverException;
15-
use InMemoryList\Domain\Model\Contracts\ListRepository;
15+
use InMemoryList\Domain\Model\Contracts\ListRepositoryInterface;
1616
use InMemoryList\Domain\Model\ListElement;
1717
use InMemoryList\Domain\Model\ListElementUuid;
18-
use InMemoryList\Infrastructure\Domain\Model\ListCollectionFactory;
18+
use InMemoryList\Infrastructure\Domain\Model\ListCollectionFactoryInterface;
1919

2020
class Client
2121
{
@@ -25,7 +25,7 @@ class Client
2525
private $driver;
2626

2727
/**
28-
* @var ListRepository
28+
* @var ListRepositoryInterface
2929
*/
3030
private $repository;
3131

@@ -83,7 +83,7 @@ private function _setRepository($driver, array $config = [])
8383
}
8484

8585
/**
86-
* @return ListRepository
86+
* @return ListRepositoryInterface
8787
*/
8888
public function getRepository()
8989
{
@@ -102,7 +102,7 @@ public function create(array $elements, array $parameters = [])
102102
{
103103
try {
104104
$this->_validateParameters($parameters);
105-
$factory = new ListCollectionFactory();
105+
$factory = new ListCollectionFactoryInterface();
106106
$list = $factory->create(
107107
$elements,
108108
(isset($parameters['headers'])) ? $parameters['headers'] : [],

src/InMemoryList/Domain/Model/Contracts/ListFactory.php src/InMemoryList/Domain/Model/Contracts/ListFactoryInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
use InMemoryList\Domain\Model\ListCollection;
1414

15-
interface ListFactory
15+
interface ListFactoryInterface
1616
{
1717
/**
1818
* @param array $elements

src/InMemoryList/Domain/Model/Contracts/ListRepository.php src/InMemoryList/Domain/Model/Contracts/ListRepositoryInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use InMemoryList\Domain\Model\ListCollection;
1414
use InMemoryList\Domain\Model\ListElement;
1515

16-
interface ListRepository
16+
interface ListRepositoryInterface
1717
{
1818
const CHUNK = 'chunk';
1919
const CHUNKSIZE = 1000;

src/InMemoryList/Domain/Model/ListCollectionUuid.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
namespace InMemoryList\Domain\Model;
1212

13-
use InMemoryList\Domain\Model\Contracts\ListRepository;
13+
use InMemoryList\Domain\Model\Contracts\ListRepositoryInterface;
1414
use InMemoryList\Domain\Model\Exceptions\ListCollectionNotAllowedUuidException;
1515
use Ramsey\Uuid\Uuid;
1616

@@ -39,11 +39,11 @@ public function __construct($uuid = null)
3939
public function _setUuid($uuid = null)
4040
{
4141
$notAllowedNames = [
42-
ListRepository::CHUNK,
43-
ListRepository::HEADERS,
44-
ListRepository::INDEX,
45-
ListRepository::SEPARATOR,
46-
ListRepository::STATISTICS,
42+
ListRepositoryInterface::CHUNK,
43+
ListRepositoryInterface::HEADERS,
44+
ListRepositoryInterface::INDEX,
45+
ListRepositoryInterface::SEPARATOR,
46+
ListRepositoryInterface::STATISTICS,
4747
];
4848

4949
foreach ($notAllowedNames as $notAllowedName) {

src/InMemoryList/Domain/Model/ListElementUuid.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
namespace InMemoryList\Domain\Model;
1212

13-
use InMemoryList\Domain\Model\Contracts\ListRepository;
13+
use InMemoryList\Domain\Model\Contracts\ListRepositoryInterface;
1414
use InMemoryList\Domain\Model\Exceptions\ListElementNotAllowedUuidException;
1515
use Ramsey\Uuid\Uuid;
1616

@@ -39,11 +39,11 @@ public function __construct($uuid = null)
3939
public function _setUUid($uuid = null)
4040
{
4141
$notAllowedNames = [
42-
ListRepository::CHUNK,
43-
ListRepository::HEADERS,
44-
ListRepository::INDEX,
45-
ListRepository::SEPARATOR,
46-
ListRepository::STATISTICS,
42+
ListRepositoryInterface::CHUNK,
43+
ListRepositoryInterface::HEADERS,
44+
ListRepositoryInterface::INDEX,
45+
ListRepositoryInterface::SEPARATOR,
46+
ListRepositoryInterface::STATISTICS,
4747
];
4848

4949
foreach ($notAllowedNames as $notAllowedName) {

src/InMemoryList/Infrastructure/Domain/Model/ListCollectionFactory.php src/InMemoryList/Infrastructure/Domain/Model/ListCollectionFactoryInterface.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
use InMemoryList\Domain\Model\ListCollection;
1515
use InMemoryList\Domain\Model\ListCollectionUuid;
1616
use InMemoryList\Domain\Model\ListElementUuid;
17-
use InMemoryList\Domain\Model\Contracts\ListFactory as Factory;
17+
use InMemoryList\Domain\Model\Contracts\ListFactoryInterface as Factory;
1818
use InMemoryList\Infrastructure\Domain\Model\Exceptions\CreateListFromEmptyArrayException;
1919
use InMemoryList\Infrastructure\Domain\Model\Exceptions\NotValidKeyElementInListException;
2020

21-
class ListCollectionFactory implements Factory
21+
class ListCollectionFactoryInterface implements Factory
2222
{
2323
/**
2424
* @param array $elements

src/InMemoryList/Infrastructure/Persistance/ApcuRepository.php src/InMemoryList/Infrastructure/Persistance/ApcuRepositoryInterface.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
use InMemoryList\Domain\Model\Exceptions\ListElementNotConsistentException;
1515
use InMemoryList\Domain\Model\ListElement;
1616
use InMemoryList\Domain\Model\ListCollection;
17-
use InMemoryList\Domain\Model\Contracts\ListRepository;
17+
use InMemoryList\Domain\Model\Contracts\ListRepositoryInterface;
1818
use InMemoryList\Domain\Model\ListElementUuid;
1919
use InMemoryList\Infrastructure\Persistance\Exceptions\ListAlreadyExistsException;
2020
use InMemoryList\Infrastructure\Persistance\Exceptions\ListDoesNotExistsException;
2121

22-
class ApcuRepository extends AbstractRepository implements ListRepository
22+
class ApcuRepositoryInterface extends AbstractRepository implements ListRepositoryInterface
2323
{
2424
/**
2525
* @param ListCollection $list
@@ -172,7 +172,7 @@ public function getHeaders($listUuid)
172172
*/
173173
public function getIndex($listUuid = null, $flush = null)
174174
{
175-
$indexKey = ListRepository::INDEX;
175+
$indexKey = ListRepositoryInterface::INDEX;
176176
$index = apcu_fetch($indexKey);
177177

178178
if ($flush && $index) {
@@ -199,7 +199,7 @@ public function getIndex($listUuid = null, $flush = null)
199199
*/
200200
private function _addOrUpdateListToIndex($listUuid, $size, $numberOfChunks, $chunkSize, $ttl = null)
201201
{
202-
$indexKey = ListRepository::INDEX;
202+
$indexKey = ListRepositoryInterface::INDEX;
203203
$indexArray = serialize([
204204
'uuid' => $listUuid,
205205
'created_on' => new \DateTimeImmutable(),
@@ -288,7 +288,7 @@ public function pushElement($listUuid, ListElement $listElement)
288288
*/
289289
public function removeListFromIndex($listUuid)
290290
{
291-
$indexKey = ListRepository::INDEX;
291+
$indexKey = ListRepositoryInterface::INDEX;
292292
$index = $this->getIndex();
293293
unset($index[(string) $listUuid]);
294294

0 commit comments

Comments
 (0)