Skip to content

Commit

Permalink
Add Pure annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry committed Dec 19, 2021
1 parent f926ca0 commit 3c4ff43
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fixtures/Bridge/Eloquent/MigratorFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
use Fidry\AliceDataFixtures\Bridge\Eloquent\Migration\FakeMigrationRepository;
use Illuminate\Database\Migrations\Migrator;
use Illuminate\Filesystem\Filesystem;
use JetBrains\PhpStorm\Pure;

class MigratorFactory
{
#[Pure]
public static function create(): Migrator
{
return new Migrator(
Expand Down
2 changes: 2 additions & 0 deletions fixtures/Bridge/Symfony/Entity/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use JetBrains\PhpStorm\Pure;

class Group
{
Expand All @@ -25,6 +26,7 @@ class Group
*/
private Collection $users;

#[Pure]
public function __construct()
{
$this->users = new ArrayCollection();
Expand Down
2 changes: 2 additions & 0 deletions fixtures/Bridge/Symfony/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use JetBrains\PhpStorm\Pure;

class User
{
Expand All @@ -25,6 +26,7 @@ class User
*/
private Collection $groups;

#[Pure]
public function __construct()
{
$this->groups = new ArrayCollection();
Expand Down
2 changes: 2 additions & 0 deletions fixtures/Bridge/Symfony/SymfonyApp/InvalidKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
namespace Fidry\AliceDataFixtures\Bridge\Symfony\SymfonyApp;

use Fidry\AliceDataFixtures\Bridge\Symfony\FidryAliceDataFixturesBundle;
use JetBrains\PhpStorm\Pure;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;

class InvalidKernel extends IsolatedKernel
{
#[Pure]
public function registerBundles(): array
{
return [
Expand Down
2 changes: 2 additions & 0 deletions fixtures/Bridge/Symfony/SymfonyApp/NakedKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
namespace Fidry\AliceDataFixtures\Bridge\Symfony\SymfonyApp;

use Fidry\AliceDataFixtures\Bridge\Symfony\FidryAliceDataFixturesBundle;
use JetBrains\PhpStorm\Pure;
use Nelmio\Alice\Bridge\Symfony\NelmioAliceBundle;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;

class NakedKernel extends IsolatedKernel
{
#[Pure]
public function registerBundles(): array
{
return [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace Fidry\AliceDataFixtures\Bridge\Symfony\DependencyInjection\Compiler;

use JetBrains\PhpStorm\Pure;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;

Expand All @@ -25,6 +26,7 @@ final class RegisterTagServicesPass implements CompilerPassInterface
private string $tagName;
private TaggedDefinitionsLocator $taggedDefinitionsLocator;

#[Pure]
public function __construct(string $registry, string $tagName)
{
$this->registry = $registry;
Expand Down
2 changes: 2 additions & 0 deletions src/Exception/MaxPassReachedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

use Fidry\AliceDataFixtures\Loader\ErrorTracker;
use Fidry\AliceDataFixtures\Loader\FileTracker;
use JetBrains\PhpStorm\Pure;
use Nelmio\Alice\Throwable\LoadingThrowable;
use RuntimeException;
use Throwable;
Expand All @@ -29,6 +30,7 @@ class MaxPassReachedException extends RuntimeException implements LoadingThrowab
*/
private array $stack = [];

#[Pure]
public function __construct($message, $code = 0, Throwable $previous = null, ErrorTracker $errorTracker = null)
{
parent::__construct($message, $code, $previous);
Expand Down
2 changes: 2 additions & 0 deletions src/Loader/FileResolverLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Fidry\AliceDataFixtures\Persistence\PersisterAwareInterface;
use Fidry\AliceDataFixtures\Persistence\PersisterInterface;
use Fidry\AliceDataFixtures\Persistence\PurgeMode;
use JetBrains\PhpStorm\Pure;
use Nelmio\Alice\IsAServiceTrait;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
Expand All @@ -35,6 +36,7 @@
private FileResolverInterface $fileResolver;
private LoggerInterface $logger;

#[Pure]
public function __construct(
LoaderInterface $decoratedLoader,
FileResolverInterface $fileResolver,
Expand Down
2 changes: 2 additions & 0 deletions src/Loader/PersisterLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Fidry\AliceDataFixtures\Persistence\PersisterInterface;
use Fidry\AliceDataFixtures\Persistence\PurgeMode;
use Fidry\AliceDataFixtures\ProcessorInterface;
use JetBrains\PhpStorm\Pure;
use Nelmio\Alice\IsAServiceTrait;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
Expand All @@ -42,6 +43,7 @@
/**
* @param ProcessorInterface[] $processors
*/
#[Pure]
public function __construct(
LoaderInterface $decoratedLoader,
PersisterInterface $persister,
Expand Down
2 changes: 2 additions & 0 deletions src/Loader/SimpleLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

use Fidry\AliceDataFixtures\LoaderInterface;
use Fidry\AliceDataFixtures\Persistence\PurgeMode;
use JetBrains\PhpStorm\Pure;
use Nelmio\Alice\FilesLoaderInterface;
use Nelmio\Alice\IsAServiceTrait;
use Psr\Log\LoggerInterface;
Expand All @@ -35,6 +36,7 @@
private FilesLoaderInterface $filesLoader;
private LoggerInterface $logger;

#[Pure]
public function __construct(FilesLoaderInterface $fileLoader, LoggerInterface $logger = null)
{
$this->filesLoader = $fileLoader;
Expand Down

0 comments on commit 3c4ff43

Please sign in to comment.