Skip to content

Commit

Permalink
fix: Update SA tools.
Browse files Browse the repository at this point in the history
Now that doctrine/persistence#213 has been released in 2.3.0.
  • Loading branch information
drupol committed Jan 9, 2022
1 parent 85a6584 commit 4b483b9
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 53 deletions.
12 changes: 0 additions & 12 deletions phpstan-doctrine-bug.neon

This file was deleted.

2 changes: 0 additions & 2 deletions phpstan.neon.dist

This file was deleted.

19 changes: 0 additions & 19 deletions psalm-baseline.xml

This file was deleted.

1 change: 0 additions & 1 deletion psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
errorBaseline="psalm-baseline.xml"
>
<projectFiles>
<directory name="src" />
Expand Down
16 changes: 1 addition & 15 deletions src/MonadicRepositoryFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,6 @@ public function fromEntity(string $entityClass): MonadicRepositoryInterface

public function fromRepository(ObjectRepository $objectRepository): MonadicRepositoryInterface
{
return $this->fromEntity($this->getEntityClass($objectRepository));
}

/**
* @template R
*
* @param ObjectRepository<R> $objectRepository
*
* @return class-string<R>
*
* @see https://github.com/doctrine/persistence/pull/213
*/
private function getEntityClass(ObjectRepository $objectRepository): string
{
return $objectRepository->getClassName();
return $this->fromEntity($objectRepository->getClassName());
}
}
8 changes: 4 additions & 4 deletions tests/unit/MonadicRepositoryHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,15 +249,15 @@ static function (CustomEntity $customEntity): string {
->eitherFind($repository->reveal(), 3)
->bind(
static function (CustomEntity $customEntity): Either {
return ('' === $customEntity->getTitle())
return ('' === $customEntity->getTitle())
? Either::left(new Exception('Empty title'))
: Either::right($customEntity);
}
}
)
->map(
static function (CustomEntity $customEntity): string {
return sprintf('%s%s', $customEntity->getTitle(), $customEntity->getTitle());
}
return sprintf('%s%s', $customEntity->getTitle(), $customEntity->getTitle());
}
)
->eval(
static fn (Throwable $i): string => $i->getMessage(),
Expand Down

0 comments on commit 4b483b9

Please sign in to comment.