Skip to content

Commit

Permalink
Add last missing return types
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN committed Mar 12, 2024
1 parent 5a655dc commit 16e6238
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 15 deletions.
5 changes: 0 additions & 5 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@
<exclude-pattern>src/*</exclude-pattern>
</rule>

<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint">
<!-- Adding return types is a BC break in most cases. -->
<exclude-pattern>src/*</exclude-pattern>
</rule>

<rule ref="Squiz.Classes.ClassFileName.NoMatch">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
Expand Down
5 changes: 1 addition & 4 deletions src/AbstractFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ abstract class AbstractFixture implements SharedFixtureInterface
*/
protected $referenceRepository;

/**
* {@inheritDoc}
*/
public function setReferenceRepository(ReferenceRepository $referenceRepository)
public function setReferenceRepository(ReferenceRepository $referenceRepository): void
{
$this->referenceRepository = $referenceRepository;
}
Expand Down
2 changes: 1 addition & 1 deletion src/DependentFixtureInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ interface DependentFixtureInterface
*
* @psalm-return array<class-string<FixtureInterface>>
*/
public function getDependencies();
public function getDependencies(): array;
}
2 changes: 1 addition & 1 deletion src/Executor/ORMExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ORMExecutor extends AbstractExecutor
public function execute(array $fixtures, bool $append = false): void
{
$executor = $this;
$this->em->wrapInTransaction(static function (EntityManagerInterface $em) use ($executor, $fixtures, $append) {
$this->em->wrapInTransaction(static function (EntityManagerInterface $em) use ($executor, $fixtures, $append): void {
if ($append === false) {
$executor->purge();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Executor/PHPCRExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function execute(array $fixtures, bool $append = false): void
{
$that = $this;

$function = static function ($dm) use ($append, $that, $fixtures) {
$function = static function ($dm) use ($append, $that, $fixtures): void {

Check warning on line 45 in src/Executor/PHPCRExecutor.php

View check run for this annotation

Codecov / codecov/patch

src/Executor/PHPCRExecutor.php#L45

Added line #L45 was not covered by tests
if ($append === false) {
$that->purge();
}
Expand Down
2 changes: 1 addition & 1 deletion src/FixtureInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ interface FixtureInterface
/**
* Load data fixtures with the passed EntityManager
*/
public function load(ObjectManager $manager);
public function load(ObjectManager $manager): void;
}
2 changes: 1 addition & 1 deletion src/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function getFixture(string $className): FixtureInterface
/**
* Add a fixture object instance to the loader.
*/
public function addFixture(FixtureInterface $fixture)
public function addFixture(FixtureInterface $fixture): void
{
$fixtureClass = $fixture::class;

Expand Down
2 changes: 1 addition & 1 deletion src/SharedFixtureInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
*/
interface SharedFixtureInterface extends FixtureInterface
{
public function setReferenceRepository(ReferenceRepository $referenceRepository);
public function setReferenceRepository(ReferenceRepository $referenceRepository): void;
}

0 comments on commit 16e6238

Please sign in to comment.