Skip to content

Commit

Permalink
Apply coding standards
Browse files Browse the repository at this point in the history
  • Loading branch information
othillo committed Jun 19, 2023
1 parent 3e5a275 commit 2fe6153
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 21 deletions.
15 changes: 0 additions & 15 deletions src/MongoDBRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ public function __construct(Collection $collection, Serializer $serializer, stri
$this->class = $class;
}

/**
* {@inheritdoc}
*/
public function save(Identifiable $model): void
{
Assert::isInstanceOf($model, $this->class);
Expand All @@ -59,19 +56,13 @@ public function save(Identifiable $model): void
$this->collection->insertOne($normalized);
}

/**
* {@inheritdoc}
*/
public function find($id): ?Identifiable
{
$document = $this->collection->findOne(['_id' => (string) $id]);

return $document ? $this->denormalizeIdentifiable($document) : null;
}

/**
* {@inheritdoc}
*/
public function findBy(array $fields): array
{
if (empty($fields)) {
Expand All @@ -81,17 +72,11 @@ public function findBy(array $fields): array
return $this->findModelsByQuery($fields);
}

/**
* {@inheritdoc}
*/
public function findAll(): array
{
return $this->findModelsByQuery();
}

/**
* {@inheritdoc}
*/
public function remove($id): void
{
$this->collection->deleteOne(['_id' => (string) $id]);
Expand Down
3 changes: 0 additions & 3 deletions src/MongoDBRepositoryFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ public function __construct(Collection $collection, Serializer $serializer)
$this->serializer = $serializer;
}

/**
* {@inheritdoc}
*/
public function create(string $name, string $class): Repository
{
return new MongoDBRepository($this->collection, $this->serializer, $class);
Expand Down
3 changes: 0 additions & 3 deletions test/MongoDBRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
*/
class MongoDBRepositoryTest extends RepositoryTestCase
{
/**
* {@inheritdoc}
*/
protected function createRepository(): Repository
{
$collection = (new Client())
Expand Down

0 comments on commit 2fe6153

Please sign in to comment.