Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize the code #12

Merged
merged 1 commit into from
Jan 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
"phpunit/phpunit": "^9.5",
"phpspec/prophecy": "^1.7",
"symfony/phpunit-bridge": "^6.0",
"phpspec/prophecy-phpunit": "^2.0"
"phpspec/prophecy-phpunit": "^2.0",
"doctrine/shards": "^1.0"
},

"extra": {
Expand Down
9 changes: 2 additions & 7 deletions fixtures/DataFixtures/Loader/FakeLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,15 @@

use Fidry\AliceDataFixtures\LoaderInterface as DataFixturesLoaderInterface;
use Fidry\AliceDataFixtures\Persistence\PurgeMode;
use function func_get_args;
use Hautelook\AliceBundle\NotCallableTrait;

/**
* @author Théo FIDRY <theo.fidry@gmail.com>
*/
class FakeLoader implements DataFixturesLoaderInterface
{
use NotCallableTrait;

/**
* {@inheritdoc}
*/
public function load(array $fixturesFiles, array $parameters = [], array $objects = [], PurgeMode $purgeMode = null): array
{
$this->__call(__METHOD__, \func_get_args());
$this->__call(__METHOD__, func_get_args());
}
}
11 changes: 3 additions & 8 deletions fixtures/DataFixtures/Loader/FakeLoaderPersisterAware.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,12 @@

use Fidry\AliceDataFixtures\Persistence\PersisterAwareInterface;
use Fidry\AliceDataFixtures\Persistence\PersisterInterface;
use function func_get_args;

/**
* @author Théo FIDRY <theo.fidry@gmail.com>
*/
class FakeLoaderPersisterAware extends FakeLoader implements PersisterAwareInterface
{
/**
* {@inheritdoc}
*/
public function withPersister(PersisterInterface $persister)
public function withPersister(PersisterInterface $persister): self
{
$this->__call(__METHOD__, \func_get_args());
$this->__call(__METHOD__, func_get_args());
}
}
9 changes: 2 additions & 7 deletions fixtures/FixtureLocator/FakeFixtureLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,16 @@

namespace Hautelook\AliceBundle\FixtureLocator;

use function func_get_args;
use Hautelook\AliceBundle\FixtureLocatorInterface;
use Hautelook\AliceBundle\NotCallableTrait;

/**
* @author Théo FIDRY <theo.fidry@gmail.com>
*/
class FakeFixtureLocator implements FixtureLocatorInterface
{
use NotCallableTrait;

/**
* {@inheritdoc}
*/
public function locateFiles(array $bundles, string $environment): array
{
$this->__call(__METHOD__, \func_get_args());
$this->__call(__METHOD__, func_get_args());
}
}
18 changes: 5 additions & 13 deletions fixtures/Functional/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@

class AppKernel extends Kernel
{
/**
* {@inheritdoc}
*/
public function registerBundles(): iterable
{
return [
Expand All @@ -39,23 +36,18 @@ public function registerBundles(): iterable
];
}

/**
* {@inheritdoc}
*/
public function registerContainerConfiguration(LoaderInterface $loader)
{
if ('public' !== $this->getEnvironment()) {
$loader->load(__DIR__.'/config/config.yml');
$loader->load(__DIR__.'/config/config.yaml');
} else {
$loader->load(__DIR__.'/config/test/config.yml');
$loader->load(__DIR__.'/config/test/config.yaml');
}
$loader->load(__DIR__.'/config/doctrine.yml');

$loader->load(__DIR__.'/config/doctrine.yaml');
}

/**
* {@inheritdoc}
*/
public function build(ContainerBuilder $container)
public function build(ContainerBuilder $container): void
{
parent::build($container);

Expand Down
16 changes: 5 additions & 11 deletions fixtures/Functional/ConfigurableKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,13 @@
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\HttpKernel\Kernel;

/**
* @author Théo FIDRY <theo.fidry@gmail.com>
*/
class ConfigurableKernel extends Kernel
{
private $addedBundles = [];

/**
* {@inheritdoc}
* @var list<Bundle>
*/
private array $addedBundles = [];

public function registerBundles(): iterable
{
return array_merge(
Expand All @@ -47,11 +44,8 @@ public function addBundle(Bundle $bundle): self
return $this;
}

/**
* {@inheritdoc}
*/
public function registerContainerConfiguration(LoaderInterface $loader)
public function registerContainerConfiguration(LoaderInterface $loader): void
{
$loader->load(__DIR__.'/config/config.yml');
$loader->load(__DIR__.'/config/config.yaml');
}
}
3 changes: 0 additions & 3 deletions fixtures/Functional/SimpleBundle/SimpleBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@

use Symfony\Component\HttpKernel\Bundle\Bundle;

/**
* @author Théo FIDRY <theo.fidry@gmail.com>
*/
class SimpleBundle extends Bundle
{
}
6 changes: 0 additions & 6 deletions fixtures/Functional/SimpleKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,8 @@
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\HttpKernel\Kernel;

/**
* @author Théo FIDRY <theo.fidry@gmail.com>
*/
class SimpleKernel extends Kernel
{
/**
* {@inheritdoc}
*/
public function registerBundles(): iterable
{
return [
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include:
- '@TestABundle/Resources/fixtures/aentity.yaml'
- '@TestBBundle/Resources/fixtures/bentity.yaml'

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

class FooProvider
{
public static function foo($str)
public static function foo(string $str): string
{
return 'foo'.$str;
}
Expand Down

This file was deleted.

9 changes: 3 additions & 6 deletions fixtures/Functional/TestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\HttpKernel\Kernel;

/**
* @author Théo FIDRY <theo.fidry@gmail.com>
*/
class TestKernel extends Kernel
{
public function registerBundles(): iterable
Expand All @@ -45,9 +42,9 @@ public function registerBundles(): iterable
];
}

public function registerContainerConfiguration(LoaderInterface $loader)
public function registerContainerConfiguration(LoaderInterface $loader): void
{
$loader->load(__DIR__.'/config/config.yml');
$loader->load(__DIR__.'/config/doctrine.yml');
$loader->load(__DIR__.'/config/config.yaml');
$loader->load(__DIR__.'/config/doctrine.yaml');
}
}
Loading