From 742d303087fb5844fddfde2ccd2013cb1b602a13 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Mon, 11 Dec 2023 16:56:37 +0100 Subject: [PATCH] tests: 'factory' replaced with 'create' --- tests/DI/Compiler.arguments.phpt | 2 +- tests/DI/Compiler.functions.phpt | 4 +- tests/DI/Compiler.generatedAccessor.phpt | 2 +- ...r.generatedFactory.nullableParameters.phpt | 2 +- ...Compiler.generatedFactory.returnTypes.phpt | 4 +- ...ler.generatedFactory.scalarParameters.phpt | 2 +- tests/DI/Compiler.services.autowiring.phpt | 6 +-- tests/DI/Compiler.services.byClass.phpt | 4 +- tests/DI/Compiler.unknownDefinitionKey.phpt | 2 +- ...erExtension.loadDefinitionsFromConfig.phpt | 2 +- tests/DI/CompilerExtension.loadFromFile.phpt | 4 +- .../ContainerBuilder.autowiring.chaining.phpt | 2 +- tests/DI/ContainerBuilder.create.error.phpt | 10 ++--- tests/DI/ContainerBuilder.metadata.phpt | 2 +- .../ContainerBuilder.resolve.Container.phpt | 2 +- ...tainerBuilder.resolveTypes.next.php80.phpt | 2 +- .../ContainerBuilder.resolveTypes.next.phpt | 24 +++++------ tests/DI/ContainerBuilder.tagged().phpt | 12 +++--- tests/DI/ContainerBuilder.typed().phpt | 2 +- tests/DI/DIExtension.exportTags.phpt | 8 ++-- tests/DI/DIExtension.exportTypes.phpt | 10 ++--- tests/DI/DecoratorExtension.basic.phpt | 2 +- tests/DI/InjectExtension.basic.phpt | 2 +- tests/DI/InjectExtension.errors.phpt | 10 ++--- tests/DI/InjectExtension.type1.phpt | 2 +- tests/DI/InjectExtension.type2.phpt | 2 +- tests/DI/NeonAdapter.basic.phpt | 12 +++--- .../DI/files/compiler.extensionOverride.neon | 40 +++++++++---------- .../compiler.parseServices.namespace.neon | 4 +- tests/DI/files/compiler.services.create.neon | 12 +++--- tests/DI/files/compiler.services.setup.neon | 4 +- tests/DI/files/neonAdapter.neon | 12 +++--- 32 files changed, 105 insertions(+), 105 deletions(-) diff --git a/tests/DI/Compiler.arguments.phpt b/tests/DI/Compiler.arguments.phpt index 36697adec..209ec021e 100644 --- a/tests/DI/Compiler.arguments.phpt +++ b/tests/DI/Compiler.arguments.phpt @@ -46,7 +46,7 @@ define('MyConstantTest', 'one'); $container = createContainer(new DI\Compiler, " services: lorem: - factory: Lorem(::MyConstantTest, Lorem::DolorSit, NOT_CONSTANT_TEST) + create: Lorem(::MyConstantTest, Lorem::DolorSit, NOT_CONSTANT_TEST) setup: - method( @lorem, @self, @container ) - method( @lorem::add(1, 2), [x: ::strtoupper('hello')] ) diff --git a/tests/DI/Compiler.functions.phpt b/tests/DI/Compiler.functions.phpt index 85df0b7e4..af46309e7 100644 --- a/tests/DI/Compiler.functions.phpt +++ b/tests/DI/Compiler.functions.phpt @@ -44,7 +44,7 @@ parameters: services: ok: - factory: Service + create: Service setup: - not( not(%f%), not(%t%), not(%fn%), not(%dynamic%), %not% ) - string( string(%f%), string(%t%), string(%fn%), string(%dynamic%), %string% ) @@ -54,7 +54,7 @@ services: bad1: Service(bool(123)) bad2: - factory: Service + create: Service setup: - method(bool(123)) ', ['dynamic' => 123]); diff --git a/tests/DI/Compiler.generatedAccessor.phpt b/tests/DI/Compiler.generatedAccessor.phpt index 443770764..1854f540e 100644 --- a/tests/DI/Compiler.generatedAccessor.phpt +++ b/tests/DI/Compiler.generatedAccessor.phpt @@ -28,7 +28,7 @@ services: lorem: Lorem lorem2: - factory: Lorem + create: Lorem autowired: no one: ILoremAccessor diff --git a/tests/DI/Compiler.generatedFactory.nullableParameters.phpt b/tests/DI/Compiler.generatedFactory.nullableParameters.phpt index 929af4eea..45ec27bf2 100644 --- a/tests/DI/Compiler.generatedFactory.nullableParameters.phpt +++ b/tests/DI/Compiler.generatedFactory.nullableParameters.phpt @@ -45,7 +45,7 @@ $container = @createContainer($compiler, ' services: article: - factory: Article(%title%, %foo%, %lorem%) + create: Article(%title%, %foo%, %lorem%) implement: IArticleFactory parameters: [?string title, ?Foo foo, ?int lorem: null] diff --git a/tests/DI/Compiler.generatedFactory.returnTypes.phpt b/tests/DI/Compiler.generatedFactory.returnTypes.phpt index 15a4d097c..5516df67f 100644 --- a/tests/DI/Compiler.generatedFactory.returnTypes.phpt +++ b/tests/DI/Compiler.generatedFactory.returnTypes.phpt @@ -38,7 +38,7 @@ $compiler = new DI\Compiler; $container = @createContainer($compiler, ' services: article: - factory: Article(%title%) + create: Article(%title%) implement: IArticleFactory parameters: [title] @@ -49,7 +49,7 @@ services: article3: implement: IArticleFactory - factory: FooArticle + create: FooArticle '); Assert::type(IArticleFactory::class, $container->getService('article')); diff --git a/tests/DI/Compiler.generatedFactory.scalarParameters.phpt b/tests/DI/Compiler.generatedFactory.scalarParameters.phpt index 68666489d..7699e5831 100644 --- a/tests/DI/Compiler.generatedFactory.scalarParameters.phpt +++ b/tests/DI/Compiler.generatedFactory.scalarParameters.phpt @@ -34,7 +34,7 @@ $compiler = new DI\Compiler; $container = @createContainer($compiler, ' services: article: - factory: Article(%title%) + create: Article(%title%) implement: IArticleFactory parameters: [string title] diff --git a/tests/DI/Compiler.services.autowiring.phpt b/tests/DI/Compiler.services.autowiring.phpt index ec043dcd2..71fcb3ab5 100644 --- a/tests/DI/Compiler.services.autowiring.phpt +++ b/tests/DI/Compiler.services.autowiring.phpt @@ -49,7 +49,7 @@ class Ipsum $container = createContainer(new DI\Compiler, ' services: model: - factory: Factory()::createModel + create: Factory()::createModel setup: # local methods - test(_) @@ -63,12 +63,12 @@ services: - @lorem::test lorem: - factory: Lorem + create: Lorem alias: @lorem ipsum: - factory: Ipsum + create: Ipsum '); diff --git a/tests/DI/Compiler.services.byClass.phpt b/tests/DI/Compiler.services.byClass.phpt index beda60a2f..30ad105af 100644 --- a/tests/DI/Compiler.services.byClass.phpt +++ b/tests/DI/Compiler.services.byClass.phpt @@ -42,10 +42,10 @@ services: three: @\Lorem one: - factory: Lorem(@\Ipsum) + create: Lorem(@\Ipsum) two: - factory: Ipsum(1) + create: Ipsum(1) setup: - @\Ipsum::foo() diff --git a/tests/DI/Compiler.unknownDefinitionKey.phpt b/tests/DI/Compiler.unknownDefinitionKey.phpt index 569013ea9..5fb189b03 100644 --- a/tests/DI/Compiler.unknownDefinitionKey.phpt +++ b/tests/DI/Compiler.unknownDefinitionKey.phpt @@ -17,7 +17,7 @@ Assert::throws(function () { createContainer(new DI\Compiler, ' services: - - factory: stdClass + create: stdClass autowire: false setups: [] foo: bar diff --git a/tests/DI/CompilerExtension.loadDefinitionsFromConfig.phpt b/tests/DI/CompilerExtension.loadDefinitionsFromConfig.phpt index 17e1c2d04..7ee2e880e 100644 --- a/tests/DI/CompilerExtension.loadDefinitionsFromConfig.phpt +++ b/tests/DI/CompilerExtension.loadDefinitionsFromConfig.phpt @@ -19,7 +19,7 @@ class CompilerExtension extends DI\CompilerExtension $config = (new DI\Config\Adapters\NeonAdapter)->load(__DIR__ . '/files/compiler.parseServices.namespace.neon'); -$config['services']['articlesList']['factory']->arguments[0] = new Reference('extension.articles'); +$config['services']['articlesList']['create']->arguments[0] = new Reference('extension.articles'); $builder = new DI\ContainerBuilder; $compiler = new DI\Compiler($builder); diff --git a/tests/DI/CompilerExtension.loadFromFile.phpt b/tests/DI/CompilerExtension.loadFromFile.phpt index 06db9cd3b..69867b4ad 100644 --- a/tests/DI/CompilerExtension.loadFromFile.phpt +++ b/tests/DI/CompilerExtension.loadFromFile.phpt @@ -21,7 +21,7 @@ class MyExtension extends Nette\DI\CompilerExtension $config = ' services: one: - factory: Ipsum + create: Ipsum '; $ext = new MyExtension; $ext->setCompiler(new DI\Compiler, 'my'); @@ -29,7 +29,7 @@ $res = $ext->loadFromFile(Tester\FileMock::create($config, 'neon')); Assert::equal([ 'services' => [ 'one' => [ - 'factory' => 'Ipsum', + 'create' => 'Ipsum', ], ], ], $res); diff --git a/tests/DI/ContainerBuilder.autowiring.chaining.phpt b/tests/DI/ContainerBuilder.autowiring.chaining.phpt index a8783d4ba..52c55efcb 100644 --- a/tests/DI/ContainerBuilder.autowiring.chaining.phpt +++ b/tests/DI/ContainerBuilder.autowiring.chaining.phpt @@ -76,6 +76,6 @@ $container = createContainer($compiler, ' services: baz: type: Baz - factory: Foo::createUnknown()::foo() + create: Foo::createUnknown()::foo() '); Assert::true($container->hasService('baz')); diff --git a/tests/DI/ContainerBuilder.create.error.phpt b/tests/DI/ContainerBuilder.create.error.phpt index 5cbbdbe75..7acf71160 100644 --- a/tests/DI/ContainerBuilder.create.error.phpt +++ b/tests/DI/ContainerBuilder.create.error.phpt @@ -295,7 +295,7 @@ services: a: stdClass b: stdClass bad: - factory: Good + create: Good setup: - $a = @\stdClass '); @@ -309,7 +309,7 @@ services: a: stdClass b: stdClass bad: - factory: Good + create: Good setup: - $a = MethodParam()::foo(@\stdClass) '); @@ -323,7 +323,7 @@ services: a: stdClass b: stdClass bad: - factory: MethodParam + create: MethodParam setup: - foo '); @@ -337,7 +337,7 @@ services: a: stdClass b: stdClass bad: - factory: Good + create: Good setup: - bar(@\stdClass) '); @@ -351,7 +351,7 @@ services: a: stdClass b: stdClass bad: - factory: Good + create: Good setup: - bar(MethodParam()::foo(@\stdClass)) '); diff --git a/tests/DI/ContainerBuilder.metadata.phpt b/tests/DI/ContainerBuilder.metadata.phpt index b293ff6c2..c553f12a9 100644 --- a/tests/DI/ContainerBuilder.metadata.phpt +++ b/tests/DI/ContainerBuilder.metadata.phpt @@ -25,7 +25,7 @@ $compiler = new DI\Compiler; $container = createContainer($compiler, ' services: lorem: - factory: stdClass + create: stdClass tags: - a b: c diff --git a/tests/DI/ContainerBuilder.resolve.Container.phpt b/tests/DI/ContainerBuilder.resolve.Container.phpt index 46a23fa63..543d42a84 100644 --- a/tests/DI/ContainerBuilder.resolve.Container.phpt +++ b/tests/DI/ContainerBuilder.resolve.Container.phpt @@ -26,7 +26,7 @@ services: lorem: Lorem next: - factory: @container::getByType(Lorem)::next() + create: @container::getByType(Lorem)::next() type: stdClass '); diff --git a/tests/DI/ContainerBuilder.resolveTypes.next.php80.phpt b/tests/DI/ContainerBuilder.resolveTypes.next.php80.phpt index b3602ce2a..9af6131da 100644 --- a/tests/DI/ContainerBuilder.resolveTypes.next.php80.phpt +++ b/tests/DI/ContainerBuilder.resolveTypes.next.php80.phpt @@ -26,6 +26,6 @@ require __DIR__ . '/../bootstrap.php'; Assert::exception(function () { $builder = new DI\ContainerBuilder; $builder->addDefinition('a') - ->setFactory([new Statement([Factory::class, 'createUnion']), 'next']); + ->setCreator([new Statement([Factory::class, 'createUnion']), 'next']); $container = createContainer($builder); }, Nette\DI\ServiceCreationException::class, "Service 'a': Return type of Factory::createUnion() is expected to not be built-in/complex, 'stdClass|array' given."); diff --git a/tests/DI/ContainerBuilder.resolveTypes.next.phpt b/tests/DI/ContainerBuilder.resolveTypes.next.phpt index 0dc9d879f..1325b5e08 100644 --- a/tests/DI/ContainerBuilder.resolveTypes.next.phpt +++ b/tests/DI/ContainerBuilder.resolveTypes.next.phpt @@ -112,84 +112,84 @@ require __DIR__ . '/../bootstrap.php'; Assert::noError(function () { $builder = new DI\ContainerBuilder; $builder->addDefinition('a') - ->setFactory([new Statement([Factory::class, 'createClassPhpDoc']), 'next']); + ->setCreator([new Statement([Factory::class, 'createClassPhpDoc']), 'next']); $container = @createContainer($builder); // @return is deprecated }); Assert::noError(function () { $builder = new DI\ContainerBuilder; $builder->addDefinition('a') - ->setFactory([new Statement([Factory::class, 'createClass']), 'next']); + ->setCreator([new Statement([Factory::class, 'createClass']), 'next']); $container = createContainer($builder); }); Assert::noError(function () { $builder = new DI\ContainerBuilder; $builder->addDefinition('a') - ->setFactory([new Statement([Factory::class, 'createNullableClassPhpDoc']), 'next']); + ->setCreator([new Statement([Factory::class, 'createNullableClassPhpDoc']), 'next']); $container = @createContainer($builder); // @return is deprecated }); Assert::noError(function () { $builder = new DI\ContainerBuilder; $builder->addDefinition('a') - ->setFactory([new Statement([Factory::class, 'createNullableClass']), 'next']); + ->setCreator([new Statement([Factory::class, 'createNullableClass']), 'next']); $container = createContainer($builder); }); Assert::exception(function () { $builder = new DI\ContainerBuilder; $builder->addDefinition('a') - ->setFactory([new Statement([Factory::class, 'createScalarPhpDoc']), 'next']); + ->setCreator([new Statement([Factory::class, 'createScalarPhpDoc']), 'next']); $container = @createContainer($builder); // @return is deprecated }, Nette\DI\ServiceCreationException::class, "Service 'a': Return type of Factory::createScalarPhpDoc() is expected to not be built-in/complex, 'array' given."); Assert::exception(function () { $builder = new DI\ContainerBuilder; $builder->addDefinition('a') - ->setFactory([new Statement([Factory::class, 'createScalar']), 'next']); + ->setCreator([new Statement([Factory::class, 'createScalar']), 'next']); $container = createContainer($builder); }, Nette\DI\ServiceCreationException::class, "Service 'a': Return type of Factory::createScalar() is expected to not be built-in/complex, 'array' given."); Assert::exception(function () { $builder = new DI\ContainerBuilder; $builder->addDefinition('a') - ->setFactory([new Statement([Factory::class, 'createObjectPhpDoc']), 'next']); + ->setCreator([new Statement([Factory::class, 'createObjectPhpDoc']), 'next']); $container = createContainer($builder); }, Nette\DI\ServiceCreationException::class, "Service 'a': Unknown service type, specify it or declare return type of factory method."); Assert::exception(function () { $builder = new DI\ContainerBuilder; $builder->addDefinition('a') - ->setFactory([new Statement([Factory::class, 'createObject']), 'next']); + ->setCreator([new Statement([Factory::class, 'createObject']), 'next']); $container = createContainer($builder); }, Nette\DI\ServiceCreationException::class, "Service 'a': Unknown service type, specify it or declare return type of factory method."); Assert::exception(function () { $builder = new DI\ContainerBuilder; $builder->addDefinition('a') - ->setFactory([new Statement([Factory::class, 'createObjectNullable']), 'next']); + ->setCreator([new Statement([Factory::class, 'createObjectNullable']), 'next']); $container = createContainer($builder); }, Nette\DI\ServiceCreationException::class, "Service 'a': Unknown service type, specify it or declare return type of factory method."); Assert::exception(function () { $builder = new DI\ContainerBuilder; $builder->addDefinition('a') - ->setFactory([new Statement([Factory::class, 'createMixedPhpDoc']), 'next']); + ->setCreator([new Statement([Factory::class, 'createMixedPhpDoc']), 'next']); $container = createContainer($builder); }, Nette\DI\ServiceCreationException::class, "Service 'a': Unknown service type, specify it or declare return type of factory method."); Assert::exception(function () { $builder = new DI\ContainerBuilder; $builder->addDefinition('a') - ->setFactory([new Statement([Factory::class, 'createMixed']), 'next']); + ->setCreator([new Statement([Factory::class, 'createMixed']), 'next']); $container = createContainer($builder); }, Nette\DI\ServiceCreationException::class, "Service 'a': Unknown service type, specify it or declare return type of factory method."); Assert::exception(function () { $builder = new DI\ContainerBuilder; $builder->addDefinition('a') - ->setFactory([new Statement([Factory::class, 'createGeneric']), 'next']); + ->setCreator([new Statement([Factory::class, 'createGeneric']), 'next']); $container = @createContainer($builder); // @return is deprecated }, Nette\DI\ServiceCreationException::class, "Service 'a': Class 'T' not found. Check the return type of Factory::createGeneric()."); diff --git a/tests/DI/ContainerBuilder.tagged().phpt b/tests/DI/ContainerBuilder.tagged().phpt index 5dd5ea611..d21dc0d71 100644 --- a/tests/DI/ContainerBuilder.tagged().phpt +++ b/tests/DI/ContainerBuilder.tagged().phpt @@ -35,22 +35,22 @@ services: f1: Foo(tagged(first)) f2: Foo(tagged(second, third)) s1: - factory: Service + create: Service tags: [first] s2: - factory: Service + create: Service tags: [first] s3: - factory: Service + create: Service tags: [first: false] s4: - factory: Service + create: Service tags: [first: null] s5: - factory: Service + create: Service tags: [second] s6: - factory: Service + create: Service tags: [third] '); diff --git a/tests/DI/ContainerBuilder.typed().phpt b/tests/DI/ContainerBuilder.typed().phpt index ac55e4980..b76287339 100644 --- a/tests/DI/ContainerBuilder.typed().phpt +++ b/tests/DI/ContainerBuilder.typed().phpt @@ -44,7 +44,7 @@ services: s3: ServiceChild s4: stdClass s5: - factory: Service + create: Service autowired: no '); diff --git a/tests/DI/DIExtension.exportTags.phpt b/tests/DI/DIExtension.exportTags.phpt index 4327ea82d..c5cbe815c 100644 --- a/tests/DI/DIExtension.exportTags.phpt +++ b/tests/DI/DIExtension.exportTags.phpt @@ -24,7 +24,7 @@ test('Tag are exported when setting is true', function () { services: - - factory: stdClass + create: stdClass tags: first: a second: b @@ -46,7 +46,7 @@ test('Tags are not exported when setting is false', function () { services: - - factory: stdClass + create: stdClass tags: first: a second: b @@ -68,7 +68,7 @@ test('Default tag export behavior without explicit setting', function () { services: - - factory: stdClass + create: stdClass tags: first: a second: b @@ -91,7 +91,7 @@ test('Specific tag export when listed', function () { services: - - factory: stdClass + create: stdClass tags: first: a second: b diff --git a/tests/DI/DIExtension.exportTypes.phpt b/tests/DI/DIExtension.exportTypes.phpt index d2dc0fe56..1a4c8ce48 100644 --- a/tests/DI/DIExtension.exportTypes.phpt +++ b/tests/DI/DIExtension.exportTypes.phpt @@ -29,7 +29,7 @@ test('Types are exported when setting is true', function () { services: one: - factory: stdClass + create: stdClass autowired: no second: stdClass @@ -50,7 +50,7 @@ test('Types are not exported when setting is false', function () { services: one: - factory: stdClass + create: stdClass autowired: no second: stdClass @@ -72,7 +72,7 @@ test('Mandatory types are exported when setting is false', function () { services: one: - factory: stdClass + create: stdClass autowired: no second: stdClass @@ -94,7 +94,7 @@ test('Mandatory types are exported without explicit setting', function () { services: one: - factory: Foo + create: Foo autowired: no second: stdClass @@ -119,7 +119,7 @@ test('Mandatory and specified types are exported', function () { services: one: - factory: Foo + create: Foo autowired: no second: stdClass diff --git a/tests/DI/DecoratorExtension.basic.phpt b/tests/DI/DecoratorExtension.basic.phpt index bf1cf50a4..4a6330bc7 100644 --- a/tests/DI/DecoratorExtension.basic.phpt +++ b/tests/DI/DecoratorExtension.basic.phpt @@ -67,7 +67,7 @@ decorator: services: one: - factory: Service + create: Service tags: [a, tag: 2] setup: - setup(Service) diff --git a/tests/DI/InjectExtension.basic.phpt b/tests/DI/InjectExtension.basic.phpt index fb8172036..1b6d3fb52 100644 --- a/tests/DI/InjectExtension.basic.phpt +++ b/tests/DI/InjectExtension.basic.phpt @@ -95,7 +95,7 @@ services: a: ConcreteDependencyA b: ConcreteDependencyB two: - factory: Service + create: Service inject: true setup: - injectB(1) diff --git a/tests/DI/InjectExtension.errors.phpt b/tests/DI/InjectExtension.errors.phpt index 1fe8baf64..39e79bbd0 100644 --- a/tests/DI/InjectExtension.errors.phpt +++ b/tests/DI/InjectExtension.errors.phpt @@ -55,7 +55,7 @@ Assert::exception(function () { createContainer($compiler, ' services: service: - factory: ServiceA + create: ServiceA inject: yes '); }, InvalidStateException::class, 'Service of type DateTimeImmutable required by ServiceA::$a not found. Did you add it to configuration file?'); @@ -67,7 +67,7 @@ Assert::exception(function () { createContainer($compiler, ' services: service: - factory: ServiceB + create: ServiceB inject: yes '); }, InvalidStateException::class, "Class 'Unknown' not found. @@ -80,7 +80,7 @@ Assert::exception(function () { createContainer($compiler, ' services: service: - factory: ServiceC + create: ServiceC inject: yes '); }, InvalidStateException::class, 'Type of property ServiceC::$a is not declared.'); @@ -92,7 +92,7 @@ Assert::error(function () { createContainer($compiler, ' services: service: - factory: ServiceD + create: ServiceD inject: yes '); }, E_USER_WARNING, 'Property ServiceD::$a for injection must be public and non-static.'); @@ -104,7 +104,7 @@ Assert::error(function () { createContainer($compiler, ' services: service: - factory: ServiceE + create: ServiceE inject: yes '); }, E_USER_WARNING, 'Property ServiceE::$a for injection must be public and non-static.'); diff --git a/tests/DI/InjectExtension.type1.phpt b/tests/DI/InjectExtension.type1.phpt index 1dcaa3436..fda2efae6 100644 --- a/tests/DI/InjectExtension.type1.phpt +++ b/tests/DI/InjectExtension.type1.phpt @@ -33,7 +33,7 @@ $container = createContainer($compiler, ' services: one: type: IService - factory: Service + create: Service inject: true '); diff --git a/tests/DI/InjectExtension.type2.phpt b/tests/DI/InjectExtension.type2.phpt index ebe3e0530..4c74488bf 100644 --- a/tests/DI/InjectExtension.type2.phpt +++ b/tests/DI/InjectExtension.type2.phpt @@ -40,7 +40,7 @@ $container = createContainer($compiler, ' services: one: type: Service - factory: ServiceFactory::create + create: ServiceFactory::create inject: true '); diff --git a/tests/DI/NeonAdapter.basic.phpt b/tests/DI/NeonAdapter.basic.phpt index 8c5830fad..ab26fca40 100644 --- a/tests/DI/NeonAdapter.basic.phpt +++ b/tests/DI/NeonAdapter.basic.phpt @@ -20,7 +20,7 @@ parameters: services: referencedService: @one referencedServiceWithSetup: - factory: @one + create: @one setup: - $x(10) @@ -35,19 +35,19 @@ services: - 1 two: - factory: %class%(1) + create: %class%(1) three: type: Lorem - factory: Factory::createLorem + create: Factory::createLorem arguments: - 1 four: - factory: Factory::createLorem(1) + create: Factory::createLorem(1) five: - factory: Factory::createLorem(1) + create: Factory::createLorem(1) six: Factory::createLorem(1) seven: @factory @@ -60,7 +60,7 @@ services: factory: Lorem rich1: Lorem(1)::foo() rich2: - factory: Lorem(Ipsum(@one))::foo(1) + create: Lorem(Ipsum(@one))::foo(1) rich3: Factory::createLorem(1)::foo() rich4: Factory()::createLorem(1)::foo() diff --git a/tests/DI/files/compiler.extensionOverride.neon b/tests/DI/files/compiler.extensionOverride.neon index 0e00e5679..99594e4e1 100644 --- a/tests/DI/files/compiler.extensionOverride.neon +++ b/tests/DI/files/compiler.extensionOverride.neon @@ -1,50 +1,50 @@ services: one1: - factory: Ipsum + create: Ipsum alteration: yes one2: - factory: Ipsum + create: Ipsum arguments: [2] one3: - factory: Ipsum(2) + create: Ipsum(2) one4: arguments: [2] one5: - factory: IpsumFactory::create + create: IpsumFactory::create one6: - factory: IpsumFactory::create + create: IpsumFactory::create arguments: [2] one7: - factory: IpsumFactory::create(2) + create: IpsumFactory::create(2) one8!: - factory: Ipsum + create: Ipsum one9: type: Ipsum one10: class: Ipsum two1: - factory: Ipsum + create: Ipsum two2: - factory: Ipsum + create: Ipsum arguments: [2] two3: - factory: Ipsum(2) + create: Ipsum(2) two4: arguments: [2] two5: - factory: IpsumFactory::create + create: IpsumFactory::create two6: - factory: IpsumFactory::create + create: IpsumFactory::create arguments: [2] two7: - factory: IpsumFactory::create(2) + create: IpsumFactory::create(2) two8: arguments: [1: new] two9: arguments!: [new] two10: - factory: Factory::createLorem(2) + create: Factory::createLorem(2) arguments: [1: new] two11: type: Ipsum @@ -52,21 +52,21 @@ services: class: Ipsum three1: - factory: Ipsum + create: Ipsum three2: - factory: Ipsum + create: Ipsum arguments: [2] three3: - factory: Ipsum(2) + create: Ipsum(2) three4: arguments: [2] three5: - factory: IpsumFactory::create + create: IpsumFactory::create three6: - factory: IpsumFactory::create + create: IpsumFactory::create arguments: [2] three7: - factory: IpsumFactory::create(2) + create: IpsumFactory::create(2) three8: type: Ipsum three9: diff --git a/tests/DI/files/compiler.parseServices.namespace.neon b/tests/DI/files/compiler.parseServices.namespace.neon index 4110b0cd1..93ce69937 100644 --- a/tests/DI/files/compiler.parseServices.namespace.neon +++ b/tests/DI/files/compiler.parseServices.namespace.neon @@ -1,7 +1,7 @@ services: comments: MyBlog\CommentsModel(@connection, @extension.articles) articlesList: - factory: MyBlog\Components\ArticlesList() + create: MyBlog\Components\ArticlesList() commentsControl: - factory: MyBlog\Components\CommentsControl + create: MyBlog\Components\CommentsControl arguments: [@extension.comments()] #factory syntax diff --git a/tests/DI/files/compiler.services.create.neon b/tests/DI/files/compiler.services.create.neon index d86fdb440..26c24e412 100644 --- a/tests/DI/files/compiler.services.create.neon +++ b/tests/DI/files/compiler.services.create.neon @@ -5,7 +5,7 @@ services: referencedService: @one referencedServiceWithSetup: - factory: @one + create: @one setup: - $arg(10) @@ -20,18 +20,18 @@ services: arguments: [1] two: - factory: %class%(1) + create: %class%(1) three: class: Lorem - factory: Factory::createLorem + create: Factory::createLorem arguments: [1, 2] four: - factory: Factory::createLorem(1) + create: Factory::createLorem(1) five: - factory: [Factory, createLorem](1) + create: [Factory, createLorem](1) six: Factory::createLorem(1) @@ -48,7 +48,7 @@ services: rich1: Lorem(1)::foo rich2: - factory: Lorem(Ipsum(@one))::foo(1) + create: Lorem(Ipsum(@one))::foo(1) rich3: Factory::createLorem(1)::foo diff --git a/tests/DI/files/compiler.services.setup.neon b/tests/DI/files/compiler.services.setup.neon index 17f12de3a..3ce6d313d 100644 --- a/tests/DI/files/compiler.services.setup.neon +++ b/tests/DI/files/compiler.services.setup.neon @@ -3,7 +3,7 @@ parameters: services: lorem: - factory: Lorem + create: Lorem setup: # local methods - test(2) @@ -41,4 +41,4 @@ services: - \Ipsum(@self) ipsum: - factory: Ipsum + create: Ipsum diff --git a/tests/DI/files/neonAdapter.neon b/tests/DI/files/neonAdapter.neon index 32bdf35f4..4aae88539 100644 --- a/tests/DI/files/neonAdapter.neon +++ b/tests/DI/files/neonAdapter.neon @@ -5,7 +5,7 @@ services: referencedService: @one referencedServiceWithSetup: - factory: @one + create: @one setup: - $x(10) @@ -20,18 +20,18 @@ services: arguments: [1] two: - factory: %class%(1) + create: %class%(1) three: type: Lorem - factory: Factory::createLorem + create: Factory::createLorem arguments: [1] four: - factory: Factory::createLorem(1) + create: Factory::createLorem(1) five: - factory: [Factory, createLorem](1) + create: [Factory, createLorem](1) six: Factory::createLorem(1) @@ -48,7 +48,7 @@ services: rich1: Lorem(1)::foo rich2: - factory: Lorem(Ipsum(@one))::foo(1) + create: Lorem(Ipsum(@one))::foo(1) rich3: Factory::createLorem(1)::foo