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 bebf2a7
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 26 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
18 changes: 9 additions & 9 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.17.0@c620f6e80d0abfca532b00bda366062aaedf6e5d">
<files psalm-version="5.23.1@8471a896ccea3526b26d082f4461eeea467f10a4">
<file src="src/Executor/PHPCRExecutor.php">
<UndefinedClass>
<code>DocumentManagerInterface</code>
<code>DocumentManagerInterface</code>
<code><![CDATA[DocumentManagerInterface]]></code>
<code><![CDATA[DocumentManagerInterface]]></code>
</UndefinedClass>
</file>
<file src="src/Purger/PHPCRPurger.php">
<UndefinedClass>
<code><![CDATA[$this->dm]]></code>
<code>DocumentManager</code>
<code>DocumentManagerInterface|null</code>
<code>NodeHelper</code>
<code>private</code>
<code><![CDATA[DocumentManager]]></code>
<code><![CDATA[DocumentManagerInterface|null]]></code>
<code><![CDATA[NodeHelper]]></code>
<code><![CDATA[private]]></code>
</UndefinedClass>
</file>
<file src="src/ReferenceRepository.php">
<UndefinedClass>
<code>PhpcrDocumentManager</code>
<code>PhpcrDocumentManager</code>
<code><![CDATA[PhpcrDocumentManager]]></code>
<code><![CDATA[PhpcrDocumentManager]]></code>
</UndefinedClass>
</file>
</files>
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: 0 additions & 2 deletions src/ReferenceRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ public function __construct(ObjectManager $manager)
*
* @param object $reference Reference object
* @param object $uow Unit of work
*
* @return array
*/
protected function getIdentifier(object $reference, object $uow): array
{
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 bebf2a7

Please sign in to comment.