Skip to content

Commit

Permalink
Remove deprecated methods
Browse files Browse the repository at this point in the history
Signed-off-by: Luís Cobucci <[email protected]>
  • Loading branch information
lcobucci committed Nov 10, 2024
1 parent f4b8a7b commit 0e5dea3
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 54 deletions.
16 changes: 0 additions & 16 deletions src/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ interface Builder
{
public const DEFAULT_PRIORITY = 0;

/**
* Changes the generator to handle the files
*
* @deprecated This is deprecated in favour of using the correct naming constructor.
*/
public function setGenerator(Generator $generator): Builder;

/**
* Add a file to be loaded
*/
Expand Down Expand Up @@ -58,15 +51,6 @@ public function addPackage(string $className, array $constructArguments = []): B
*/
public function setProfileName(string $profileName): Builder;

/**
* Mark the container to be used as development mode
*
* @deprecated this method will be removed in favour of a more explicit name.
*
* @see enableDebugging
*/
public function useDevelopmentMode(): Builder;

/**
* Configure the container to track file updates
*/
Expand Down
25 changes: 0 additions & 25 deletions src/ContainerBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,6 @@ public function __construct(
$this->setDefaultConfiguration();
}

/**
* @deprecated Use the named constructor according to the generator
*
* @see ContainerBuilder::xml()
* @see ContainerBuilder::yaml()
* @see ContainerBuilder::php()
* @see ContainerBuilder::delegating()
*/
public static function default(string $configurationFile, string $namespace): self
{
return self::xml($configurationFile, $namespace);
}

/** @param class-string<SymfonyBuilder> $builderClass */
public static function xml(
string $configurationFile,
Expand Down Expand Up @@ -100,13 +87,6 @@ private function setDefaultConfiguration(): void
$this->config->addPass($this->parameterBag);
}

public function setGenerator(Generator $generator): Builder
{
$this->generator = $generator;

return $this;
}

public function addFile(string $file): Builder
{
$this->config->addFile($file);
Expand Down Expand Up @@ -151,11 +131,6 @@ public function setProfileName(string $profileName): Builder
return $this;
}

public function useDevelopmentMode(): Builder
{
return $this->enableDebugging();
}

public function enableDebugging(): Builder
{
$this->parameterBag->set('app.devmode', true);
Expand Down
13 changes: 0 additions & 13 deletions test/ContainerBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public function namedConstructorsShouldSimplifyTheObjectCreation(
/** @return iterable<string, array{string, Generator, 2?: class-string<\Symfony\Component\DependencyInjection\ContainerBuilder>}> */
public static function supportedFormats(): iterable
{
yield 'default' => ['default', new Generators\Xml(__FILE__)];
yield 'xml' => ['xml', new Generators\Xml(__FILE__)];
yield 'yaml' => ['yaml', new Generators\Yaml(__FILE__)];
yield 'php' => ['php', new Generators\Php(__FILE__)];
Expand Down Expand Up @@ -99,18 +98,6 @@ public function constructShouldReceiveTheDependenciesAsArguments(): void
self::assertFalse($this->parameterBag->get('app.devmode'));
}

#[PHPUnit\Test]
public function setGeneratorShouldChangeTheAttributeAndReturnSelf(): void
{
$builder = new ContainerBuilder($this->config, $this->generator, $this->parameterBag);
$generator = $this->createMock(Generator::class);
$expected = new ContainerBuilder($this->config, $generator, $this->parameterBag);

// @phpstan-ignore-next-line method is deprecated and will be removed in the next major version
self::assertSame($builder, $builder->setGenerator($generator));
self::assertEquals($expected, $builder);
}

#[PHPUnit\Test]
public function addFileShouldAppendANewFileOnTheListAndReturnSelf(): void
{
Expand Down

0 comments on commit 0e5dea3

Please sign in to comment.