Skip to content
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
1 change: 1 addition & 0 deletions UPGRADE-5.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ DependencyInjection
configure them explicitly instead.
* Deprecated `Definition::getDeprecationMessage()`, use `Definition::getDeprecation()` instead.
* Deprecated `Alias::getDeprecationMessage()`, use `Alias::getDeprecation()` instead.
* The `inline()` function from the PHP-DSL has been deprecated, use `service()` instead

Dotenv
------
Expand Down
1 change: 1 addition & 0 deletions UPGRADE-6.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ DependencyInjection
configure them explicitly instead.
* Removed `Definition::getDeprecationMessage()`, use `Definition::getDeprecation()` instead.
* Removed `Alias::getDeprecationMessage()`, use `Alias::getDeprecation()` instead.
* The `inline()` function from the PHP-DSL has been removed, use `service()` instead

Dotenv
------
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/DependencyInjection/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ CHANGELOG
* added tags `container.preload`/`.no_preload` to declare extra classes to preload/services to not preload
* deprecated `Definition::getDeprecationMessage()`, use `Definition::getDeprecation()` instead
* deprecated `Alias::getDeprecationMessage()`, use `Alias::getDeprecation()` instead
* deprecated PHP-DSL's `inline()` function, use `service()` instead

5.0.0
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,20 @@ function ref(string $id): ReferenceConfigurator

/**
* Creates an inline service.
*
* @deprecated since Symfony 5.1, use service() instead.
*/
function inline(string $class = null): InlineServiceConfigurator
{
trigger_deprecation('symfony/dependency-injection', '5.1', '"%s()" is deprecated, use "service()" instead.', __FUNCTION__);

return new InlineServiceConfigurator(new Definition($class));
}

/**
* Creates an inline service.
*/
function service(string $class = null): InlineServiceConfigurator
{
return new InlineServiceConfigurator(new Definition($class));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
class InlineServiceConfigurator extends AbstractConfigurator
{
const FACTORY = 'inline';
const FACTORY = 'service';

use Traits\ArgumentTrait;
use Traits\AutowireTrait;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
return function (ContainerConfigurator $c) {
$s = $c->services();
$s->set(BarService::class)
->args([inline('FooClass')]);
->args([service('FooClass')]);
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ public function __invoke(ContainerConfigurator $c)
{
$s = $c->services();
$s->set(BarService::class)
->args([inline('FooClass')]);
->args([service('FooClass')]);
}
};