Skip to content

Commit

Permalink
Modernize the code (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry authored Jan 1, 2022
1 parent 021d448 commit 016ff23
Show file tree
Hide file tree
Showing 82 changed files with 537 additions and 1,049 deletions.
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 <[email protected]>
*/
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 <[email protected]>
*/
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 <[email protected]>
*/
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 <[email protected]>
*/
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 <[email protected]>
*/
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 <[email protected]>
*/
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 <[email protected]>
*/
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

0 comments on commit 016ff23

Please sign in to comment.