From 847c75be02c665825504497697524ef62427e5ee Mon Sep 17 00:00:00 2001 From: TomasVotruba Date: Fri, 24 Jan 2020 09:47:58 +0100 Subject: [PATCH] decouple to @migrify --- .github/workflows/binary_files.yaml | 1 - README.md | 10 +- composer.json | 4 - monorepo-builder.yaml | 2 - packages/LatteToTwigConverter/.gitattributes | 5 - .../LatteToTwigConverter/.github/FUNDING.yml | 3 - .../.github/workflows/code_checks.yaml | 40 ---- packages/LatteToTwigConverter/.gitignore | 2 - packages/LatteToTwigConverter/LICENSE | 25 --- packages/LatteToTwigConverter/README.md | 79 ------- .../bin/latte-to-twig-converter | 35 --- packages/LatteToTwigConverter/composer.json | 39 ---- .../LatteToTwigConverter/config/config.yaml | 15 -- packages/LatteToTwigConverter/phpunit.xml | 9 - .../src/CaseConverter/BlockCaseConverter.php | 68 ------ .../CaseConverter/CaptureCaseConverter.php | 27 --- .../CaseConverter/CommentCaseConverter.php | 21 -- .../CaseConverter/ConditionCaseConverter.php | 40 ---- .../src/CaseConverter/DateCaseConverter.php | 21 -- .../CaseConverter/DefaultCaseConverter.php | 28 --- .../src/CaseConverter/FilterCaseConverter.php | 80 ------- .../IncludeToBlockCaseConverter.php | 21 -- .../src/CaseConverter/LoopsCaseConverter.php | 53 ----- .../NClassMacroCaseConverter.php | 26 --- .../CaseConverter/NMacrosCaseConverter.php | 109 --------- .../RenameMacroCaseConverter.php | 21 -- .../CaseConverter/SprintfCaseConverter.php | 21 -- .../src/CaseConverter/SuffixCaseConverter.php | 22 -- .../CaseConverter/VariableCaseConverter.php | 97 -------- .../src/Command/ConvertCommand.php | 88 -------- .../LatteToTwigConverterApplication.php | 20 -- .../CaseConverter/CaseConverterInterface.php | 15 -- .../src/Exception/ConfigurationException.php | 11 - .../src/Finder/LatteAndTwigFinder.php | 40 ---- .../HttpKernel/LatteToTwigConverterKernel.php | 48 ---- .../src/LatteToTwigConverter.php | 54 ----- .../latte/arkadiuszkondas_default.latte | 66 ------ .../twig/arkadiuszkondas_default.twig | 66 ------ .../tests/LatteToTwigConverterTest.php | 87 -------- .../tests/Source/latte/block-file.latte | 19 -- .../tests/Source/latte/capture.latte | 6 - .../tests/Source/latte/comment.latte | 7 - .../tests/Source/latte/conditions.latte | 18 -- .../tests/Source/latte/date.latte | 1 - .../tests/Source/latte/default.latte | 2 - .../tests/Source/latte/extends.latte | 1 - .../tests/Source/latte/filter.latte | 8 - .../Source/latte/filter_with_arguments.latte | 3 - .../Source/latte/filter_with_number.latte | 3 - .../tests/Source/latte/first_last.latte | 5 - .../tests/Source/latte/include.latte | 2 - .../tests/Source/latte/javascript.latte | 8 - .../tests/Source/latte/loops.latte | 14 -- .../tests/Source/latte/n-macro/n-class.latte | 1 - .../Source/latte/n-macro/n-foreach.latte | 3 - .../tests/Source/latte/n-macro/n-if.latte | 1 - .../tests/Source/latte/n-macro/n-ifset.latte | 1 - .../latte/n-macro/n-inner-foreach.latte | 6 - .../tests/Source/latte/nested_variable.latte | 9 - .../tests/Source/latte/spaceless.latte | 3 - .../tests/Source/latte/sprintf.latte | 1 - .../tests/Source/latte/variables.latte | 19 -- .../tests/Source/twig/block-file.twig | 19 -- .../tests/Source/twig/capture.twig | 6 - .../tests/Source/twig/comment.twig | 7 - .../tests/Source/twig/conditions.twig | 18 -- .../tests/Source/twig/date.twig | 1 - .../tests/Source/twig/default.twig | 2 - .../tests/Source/twig/extends.twig | 1 - .../tests/Source/twig/filter.twig | 8 - .../Source/twig/filter_with_arguments.twig | 3 - .../tests/Source/twig/filter_with_number.twig | 3 - .../tests/Source/twig/first_last.twig | 5 - .../tests/Source/twig/include.twig | 2 - .../tests/Source/twig/javascript.twig | 8 - .../tests/Source/twig/loops.twig | 14 -- .../tests/Source/twig/n-macro/n-class.twig | 1 - .../tests/Source/twig/n-macro/n-foreach.twig | 5 - .../tests/Source/twig/n-macro/n-if.twig | 3 - .../tests/Source/twig/n-macro/n-ifset.twig | 3 - .../Source/twig/n-macro/n-inner-foreach.twig | 10 - .../tests/Source/twig/nested_variable.twig | 9 - .../tests/Source/twig/spaceless.twig | 3 - .../tests/Source/twig/sprintf.twig | 1 - .../tests/Source/twig/variables.twig | 19 -- packages/NeonToYamlConverter/.gitattributes | 5 - .../NeonToYamlConverter/.github/FUNDING.yml | 3 - .../.github/workflows/code_checks.yaml | 40 ---- packages/NeonToYamlConverter/.gitignore | 2 - packages/NeonToYamlConverter/LICENSE | 25 --- packages/NeonToYamlConverter/README.md | 63 ------ .../bin/neon-to-yaml-converter | 37 --- packages/NeonToYamlConverter/composer.json | 38 ---- .../NeonToYamlConverter/config/config.yaml | 15 -- packages/NeonToYamlConverter/phpunit.xml | 9 - .../src/ArrayParameterCollector.php | 58 ----- .../src/Command/ConvertCommand.php | 98 -------- .../NeonToYamlConverterApplication.php | 20 -- .../ParameterConverterWorker.php | 55 ----- .../ServiceConverterWorker.php | 210 ------------------ .../src/Finder/NeonAndYamlFinder.php | 40 ---- .../src/Formatter/YamlOutputFormatter.php | 27 --- .../HttpKernel/NeonToYamlConverterKernel.php | 44 ---- .../src/NeonToYamlConverter.php | 174 --------------- .../MultipleFileSource/neon/parameters.neon | 4 - .../MultipleFileSource/neon/services.neon | 5 - .../MultipleFileSource/yaml/parameters.yaml | 3 - .../MultipleFileSource/yaml/services.yaml | 5 - .../tests/MultipleFileTest.php | 61 ----- .../tests/NeonToYamlConverterTest.php | 92 -------- .../tests/Source/neon/entity.neon | 1 - .../tests/Source/neon/env.neon | 3 - .../tests/Source/neon/imports.neon | 3 - .../tests/Source/neon/lists.neon | 7 - .../tests/Source/neon/multi_line_content.neon | 4 - .../neon/parameters/app_dir_parameter.neon | 8 - .../neon/parameters/nested_parameter.neon | 12 - .../parameters/skip_parameter_inline.neon | 9 - .../tests/Source/neon/services/alias.neon | 3 - .../tests/Source/neon/services/arguments.neon | 2 - .../tests/Source/neon/services/basic.neon | 7 - .../tests/Source/neon/services/entity.neon | 2 - .../tests/Source/neon/services/list.neon | 16 -- .../tests/Source/neon/services/null.neon | 2 - .../tests/Source/neon/services/setup.neon | 7 - .../neon/services/without_namespace.neon | 2 - .../tests/Source/neon/tilda.neon | 3 - .../tests/Source/yaml/entity.yaml | 4 - .../tests/Source/yaml/env.yaml | 3 - .../tests/Source/yaml/imports.yaml | 3 - .../tests/Source/yaml/lists.yaml | 7 - .../tests/Source/yaml/multi_line_content.yaml | 3 - .../yaml/parameters/app_dir_parameter.yaml | 8 - .../yaml/parameters/nested_parameter.yaml | 11 - .../parameters/skip_parameter_inline.yaml | 9 - .../tests/Source/yaml/services/alias.yaml | 5 - .../tests/Source/yaml/services/arguments.yaml | 9 - .../tests/Source/yaml/services/basic.yaml | 18 -- .../tests/Source/yaml/services/entity.yaml | 4 - .../tests/Source/yaml/services/list.yaml | 20 -- .../tests/Source/yaml/services/null.yaml | 2 - .../tests/Source/yaml/services/setup.yaml | 10 - .../yaml/services/without_namespace.yaml | 5 - .../tests/Source/yaml/tilda.yaml | 3 - 144 files changed, 1 insertion(+), 3058 deletions(-) delete mode 100644 packages/LatteToTwigConverter/.gitattributes delete mode 100644 packages/LatteToTwigConverter/.github/FUNDING.yml delete mode 100644 packages/LatteToTwigConverter/.github/workflows/code_checks.yaml delete mode 100644 packages/LatteToTwigConverter/.gitignore delete mode 100644 packages/LatteToTwigConverter/LICENSE delete mode 100644 packages/LatteToTwigConverter/README.md delete mode 100755 packages/LatteToTwigConverter/bin/latte-to-twig-converter delete mode 100644 packages/LatteToTwigConverter/composer.json delete mode 100644 packages/LatteToTwigConverter/config/config.yaml delete mode 100644 packages/LatteToTwigConverter/phpunit.xml delete mode 100644 packages/LatteToTwigConverter/src/CaseConverter/BlockCaseConverter.php delete mode 100644 packages/LatteToTwigConverter/src/CaseConverter/CaptureCaseConverter.php delete mode 100644 packages/LatteToTwigConverter/src/CaseConverter/CommentCaseConverter.php delete mode 100644 packages/LatteToTwigConverter/src/CaseConverter/ConditionCaseConverter.php delete mode 100644 packages/LatteToTwigConverter/src/CaseConverter/DateCaseConverter.php delete mode 100644 packages/LatteToTwigConverter/src/CaseConverter/DefaultCaseConverter.php delete mode 100644 packages/LatteToTwigConverter/src/CaseConverter/FilterCaseConverter.php delete mode 100644 packages/LatteToTwigConverter/src/CaseConverter/IncludeToBlockCaseConverter.php delete mode 100644 packages/LatteToTwigConverter/src/CaseConverter/LoopsCaseConverter.php delete mode 100644 packages/LatteToTwigConverter/src/CaseConverter/NClassMacroCaseConverter.php delete mode 100644 packages/LatteToTwigConverter/src/CaseConverter/NMacrosCaseConverter.php delete mode 100644 packages/LatteToTwigConverter/src/CaseConverter/RenameMacroCaseConverter.php delete mode 100644 packages/LatteToTwigConverter/src/CaseConverter/SprintfCaseConverter.php delete mode 100644 packages/LatteToTwigConverter/src/CaseConverter/SuffixCaseConverter.php delete mode 100644 packages/LatteToTwigConverter/src/CaseConverter/VariableCaseConverter.php delete mode 100644 packages/LatteToTwigConverter/src/Command/ConvertCommand.php delete mode 100644 packages/LatteToTwigConverter/src/Console/LatteToTwigConverterApplication.php delete mode 100644 packages/LatteToTwigConverter/src/Contract/CaseConverter/CaseConverterInterface.php delete mode 100644 packages/LatteToTwigConverter/src/Exception/ConfigurationException.php delete mode 100644 packages/LatteToTwigConverter/src/Finder/LatteAndTwigFinder.php delete mode 100644 packages/LatteToTwigConverter/src/HttpKernel/LatteToTwigConverterKernel.php delete mode 100644 packages/LatteToTwigConverter/src/LatteToTwigConverter.php delete mode 100644 packages/LatteToTwigConverter/tests/ComplexSource/latte/arkadiuszkondas_default.latte delete mode 100644 packages/LatteToTwigConverter/tests/ComplexSource/twig/arkadiuszkondas_default.twig delete mode 100644 packages/LatteToTwigConverter/tests/LatteToTwigConverterTest.php delete mode 100644 packages/LatteToTwigConverter/tests/Source/latte/block-file.latte delete mode 100644 packages/LatteToTwigConverter/tests/Source/latte/capture.latte delete mode 100644 packages/LatteToTwigConverter/tests/Source/latte/comment.latte delete mode 100644 packages/LatteToTwigConverter/tests/Source/latte/conditions.latte delete mode 100644 packages/LatteToTwigConverter/tests/Source/latte/date.latte delete mode 100644 packages/LatteToTwigConverter/tests/Source/latte/default.latte delete mode 100644 packages/LatteToTwigConverter/tests/Source/latte/extends.latte delete mode 100644 packages/LatteToTwigConverter/tests/Source/latte/filter.latte delete mode 100644 packages/LatteToTwigConverter/tests/Source/latte/filter_with_arguments.latte delete mode 100644 packages/LatteToTwigConverter/tests/Source/latte/filter_with_number.latte delete mode 100644 packages/LatteToTwigConverter/tests/Source/latte/first_last.latte delete mode 100644 packages/LatteToTwigConverter/tests/Source/latte/include.latte delete mode 100644 packages/LatteToTwigConverter/tests/Source/latte/javascript.latte delete mode 100644 packages/LatteToTwigConverter/tests/Source/latte/loops.latte delete mode 100644 packages/LatteToTwigConverter/tests/Source/latte/n-macro/n-class.latte delete mode 100644 packages/LatteToTwigConverter/tests/Source/latte/n-macro/n-foreach.latte delete mode 100644 packages/LatteToTwigConverter/tests/Source/latte/n-macro/n-if.latte delete mode 100644 packages/LatteToTwigConverter/tests/Source/latte/n-macro/n-ifset.latte delete mode 100644 packages/LatteToTwigConverter/tests/Source/latte/n-macro/n-inner-foreach.latte delete mode 100644 packages/LatteToTwigConverter/tests/Source/latte/nested_variable.latte delete mode 100644 packages/LatteToTwigConverter/tests/Source/latte/spaceless.latte delete mode 100644 packages/LatteToTwigConverter/tests/Source/latte/sprintf.latte delete mode 100644 packages/LatteToTwigConverter/tests/Source/latte/variables.latte delete mode 100644 packages/LatteToTwigConverter/tests/Source/twig/block-file.twig delete mode 100644 packages/LatteToTwigConverter/tests/Source/twig/capture.twig delete mode 100644 packages/LatteToTwigConverter/tests/Source/twig/comment.twig delete mode 100644 packages/LatteToTwigConverter/tests/Source/twig/conditions.twig delete mode 100644 packages/LatteToTwigConverter/tests/Source/twig/date.twig delete mode 100644 packages/LatteToTwigConverter/tests/Source/twig/default.twig delete mode 100644 packages/LatteToTwigConverter/tests/Source/twig/extends.twig delete mode 100644 packages/LatteToTwigConverter/tests/Source/twig/filter.twig delete mode 100644 packages/LatteToTwigConverter/tests/Source/twig/filter_with_arguments.twig delete mode 100644 packages/LatteToTwigConverter/tests/Source/twig/filter_with_number.twig delete mode 100644 packages/LatteToTwigConverter/tests/Source/twig/first_last.twig delete mode 100644 packages/LatteToTwigConverter/tests/Source/twig/include.twig delete mode 100644 packages/LatteToTwigConverter/tests/Source/twig/javascript.twig delete mode 100644 packages/LatteToTwigConverter/tests/Source/twig/loops.twig delete mode 100644 packages/LatteToTwigConverter/tests/Source/twig/n-macro/n-class.twig delete mode 100644 packages/LatteToTwigConverter/tests/Source/twig/n-macro/n-foreach.twig delete mode 100644 packages/LatteToTwigConverter/tests/Source/twig/n-macro/n-if.twig delete mode 100644 packages/LatteToTwigConverter/tests/Source/twig/n-macro/n-ifset.twig delete mode 100644 packages/LatteToTwigConverter/tests/Source/twig/n-macro/n-inner-foreach.twig delete mode 100644 packages/LatteToTwigConverter/tests/Source/twig/nested_variable.twig delete mode 100644 packages/LatteToTwigConverter/tests/Source/twig/spaceless.twig delete mode 100644 packages/LatteToTwigConverter/tests/Source/twig/sprintf.twig delete mode 100644 packages/LatteToTwigConverter/tests/Source/twig/variables.twig delete mode 100644 packages/NeonToYamlConverter/.gitattributes delete mode 100644 packages/NeonToYamlConverter/.github/FUNDING.yml delete mode 100644 packages/NeonToYamlConverter/.github/workflows/code_checks.yaml delete mode 100644 packages/NeonToYamlConverter/.gitignore delete mode 100644 packages/NeonToYamlConverter/LICENSE delete mode 100644 packages/NeonToYamlConverter/README.md delete mode 100755 packages/NeonToYamlConverter/bin/neon-to-yaml-converter delete mode 100644 packages/NeonToYamlConverter/composer.json delete mode 100644 packages/NeonToYamlConverter/config/config.yaml delete mode 100644 packages/NeonToYamlConverter/phpunit.xml delete mode 100644 packages/NeonToYamlConverter/src/ArrayParameterCollector.php delete mode 100644 packages/NeonToYamlConverter/src/Command/ConvertCommand.php delete mode 100644 packages/NeonToYamlConverter/src/Console/NeonToYamlConverterApplication.php delete mode 100644 packages/NeonToYamlConverter/src/ConverterWorker/ParameterConverterWorker.php delete mode 100644 packages/NeonToYamlConverter/src/ConverterWorker/ServiceConverterWorker.php delete mode 100644 packages/NeonToYamlConverter/src/Finder/NeonAndYamlFinder.php delete mode 100644 packages/NeonToYamlConverter/src/Formatter/YamlOutputFormatter.php delete mode 100644 packages/NeonToYamlConverter/src/HttpKernel/NeonToYamlConverterKernel.php delete mode 100644 packages/NeonToYamlConverter/src/NeonToYamlConverter.php delete mode 100644 packages/NeonToYamlConverter/tests/MultipleFileSource/neon/parameters.neon delete mode 100644 packages/NeonToYamlConverter/tests/MultipleFileSource/neon/services.neon delete mode 100644 packages/NeonToYamlConverter/tests/MultipleFileSource/yaml/parameters.yaml delete mode 100644 packages/NeonToYamlConverter/tests/MultipleFileSource/yaml/services.yaml delete mode 100644 packages/NeonToYamlConverter/tests/MultipleFileTest.php delete mode 100644 packages/NeonToYamlConverter/tests/NeonToYamlConverterTest.php delete mode 100644 packages/NeonToYamlConverter/tests/Source/neon/entity.neon delete mode 100644 packages/NeonToYamlConverter/tests/Source/neon/env.neon delete mode 100644 packages/NeonToYamlConverter/tests/Source/neon/imports.neon delete mode 100644 packages/NeonToYamlConverter/tests/Source/neon/lists.neon delete mode 100644 packages/NeonToYamlConverter/tests/Source/neon/multi_line_content.neon delete mode 100644 packages/NeonToYamlConverter/tests/Source/neon/parameters/app_dir_parameter.neon delete mode 100644 packages/NeonToYamlConverter/tests/Source/neon/parameters/nested_parameter.neon delete mode 100644 packages/NeonToYamlConverter/tests/Source/neon/parameters/skip_parameter_inline.neon delete mode 100644 packages/NeonToYamlConverter/tests/Source/neon/services/alias.neon delete mode 100644 packages/NeonToYamlConverter/tests/Source/neon/services/arguments.neon delete mode 100644 packages/NeonToYamlConverter/tests/Source/neon/services/basic.neon delete mode 100644 packages/NeonToYamlConverter/tests/Source/neon/services/entity.neon delete mode 100644 packages/NeonToYamlConverter/tests/Source/neon/services/list.neon delete mode 100644 packages/NeonToYamlConverter/tests/Source/neon/services/null.neon delete mode 100644 packages/NeonToYamlConverter/tests/Source/neon/services/setup.neon delete mode 100644 packages/NeonToYamlConverter/tests/Source/neon/services/without_namespace.neon delete mode 100644 packages/NeonToYamlConverter/tests/Source/neon/tilda.neon delete mode 100644 packages/NeonToYamlConverter/tests/Source/yaml/entity.yaml delete mode 100644 packages/NeonToYamlConverter/tests/Source/yaml/env.yaml delete mode 100644 packages/NeonToYamlConverter/tests/Source/yaml/imports.yaml delete mode 100644 packages/NeonToYamlConverter/tests/Source/yaml/lists.yaml delete mode 100644 packages/NeonToYamlConverter/tests/Source/yaml/multi_line_content.yaml delete mode 100644 packages/NeonToYamlConverter/tests/Source/yaml/parameters/app_dir_parameter.yaml delete mode 100644 packages/NeonToYamlConverter/tests/Source/yaml/parameters/nested_parameter.yaml delete mode 100644 packages/NeonToYamlConverter/tests/Source/yaml/parameters/skip_parameter_inline.yaml delete mode 100644 packages/NeonToYamlConverter/tests/Source/yaml/services/alias.yaml delete mode 100644 packages/NeonToYamlConverter/tests/Source/yaml/services/arguments.yaml delete mode 100644 packages/NeonToYamlConverter/tests/Source/yaml/services/basic.yaml delete mode 100644 packages/NeonToYamlConverter/tests/Source/yaml/services/entity.yaml delete mode 100644 packages/NeonToYamlConverter/tests/Source/yaml/services/list.yaml delete mode 100644 packages/NeonToYamlConverter/tests/Source/yaml/services/null.yaml delete mode 100644 packages/NeonToYamlConverter/tests/Source/yaml/services/setup.yaml delete mode 100644 packages/NeonToYamlConverter/tests/Source/yaml/services/without_namespace.yaml delete mode 100644 packages/NeonToYamlConverter/tests/Source/yaml/tilda.yaml diff --git a/.github/workflows/binary_files.yaml b/.github/workflows/binary_files.yaml index 7d1e36c14f..bbd3b5c2a5 100644 --- a/.github/workflows/binary_files.yaml +++ b/.github/workflows/binary_files.yaml @@ -25,7 +25,6 @@ jobs: packages/EasyCodingStandard/bin/ecs packages/ChangelogLinker/bin/changelog-linker packages/Statie/bin/statie - packages/LatteToTwigConverter/bin/latte-to-twig-converter packages/MonorepoBuilder/bin/monorepo-builder # test "check" options diff --git a/README.md b/README.md index 8f463e3235..292990b272 100644 --- a/README.md +++ b/README.md @@ -91,15 +91,7 @@ You'll find all packages in [`/packages`](/packages) directory. Here is a brief ## Migration Utils -- **[LatteToTwigConverter](https://github.com/Symplify/LatteToTwigConverter)** - Converts Latte templates to Twig - - [![Build Status](https://img.shields.io/github/workflow/status/Symplify/LatteToTwigConverter/Code_Checks?style=flat-square)](https://github.com/Symplify/LatteToTwigConverter/actions) - [![Downloads](https://img.shields.io/packagist/dt/symplify/latte-to-twig-converter.svg?style=flat-square)](https://packagist.org/packages/symplify/latte-to-twig-converter/stats) - -- **[NeonToYamlConverter](https://github.com/Symplify/NeonToYamlConverter)** - Converts NEON files to YAML - - [![Build Status](https://img.shields.io/github/workflow/status/Symplify/NeonToYamlConverter/Code_Checks?style=flat-square)](https://github.com/Symplify/NeonToYamlConverter/actions) - [![Downloads](https://img.shields.io/packagist/dt/symplify/neon-to-yaml-converter.svg?style=flat-square)](https://packagist.org/packages/symplify/neon-to-yaml-converter/stats) +- All migration utils were moved to [Migrify](https://github.com/migrify/migrify/) project. ## Install diff --git a/composer.json b/composer.json index b1356b9956..2452f4fc97 100644 --- a/composer.json +++ b/composer.json @@ -70,12 +70,10 @@ "Symplify\\EasyCodingStandard\\FixerRunner\\": "packages/EasyCodingStandard/packages/FixerRunner/src", "Symplify\\EasyCodingStandard\\SniffRunner\\": "packages/EasyCodingStandard/packages/SniffRunner/src", "Symplify\\FlexLoader\\": "packages/FlexLoader/src", - "Symplify\\LatteToTwigConverter\\": "packages/LatteToTwigConverter/src", "Symplify\\MonorepoBuilder\\": "packages/MonorepoBuilder/src", "Symplify\\MonorepoBuilder\\Init\\": "packages/MonorepoBuilder/packages/Init/src", "Symplify\\MonorepoBuilder\\Release\\": "packages/MonorepoBuilder/packages/Release/src", "Symplify\\MonorepoBuilder\\Split\\": "packages/MonorepoBuilder/packages/Split/src", - "Symplify\\NeonToYamlConverter\\": "packages/NeonToYamlConverter/src", "Symplify\\PHPStanExtensions\\": "packages/PHPStanExtensions/src", "Symplify\\PackageBuilder\\": "packages/PackageBuilder/src", "Symplify\\SetConfigResolver\\": "packages/SetConfigResolver/src", @@ -109,10 +107,8 @@ "Symplify\\EasyCodingStandard\\SniffRunner\\Tests\\": "packages/EasyCodingStandard/packages/SniffRunner/tests", "Symplify\\EasyCodingStandard\\Tests\\": "packages/EasyCodingStandard/tests", "Symplify\\FlexLoader\\Tests\\": "packages/FlexLoader/tests", - "Symplify\\LatteToTwigConverter\\Tests\\": "packages/LatteToTwigConverter/tests", "Symplify\\MonorepoBuilder\\Split\\Tests\\": "packages/MonorepoBuilder/packages/Split/tests", "Symplify\\MonorepoBuilder\\Tests\\": "packages/MonorepoBuilder/tests", - "Symplify\\NeonToYamlConverter\\Tests\\": "packages/NeonToYamlConverter/tests", "Symplify\\PHPStanExtensions\\Tests\\": "packages/PHPStanExtensions/tests", "Symplify\\PackageBuilder\\Tests\\": "packages/PackageBuilder/tests", "Symplify\\SetConfigResolver\\Tests\\": "packages/SetConfigResolver/tests", diff --git a/monorepo-builder.yaml b/monorepo-builder.yaml index d7725be9ac..1397a194c9 100644 --- a/monorepo-builder.yaml +++ b/monorepo-builder.yaml @@ -16,8 +16,6 @@ parameters: directories_to_repositories: packages/AutowireArrayParameter: 'git@github.com:Symplify/AutowireArrayParameter.git' packages/AutoBindParameter: 'git@github.com:Symplify/AutoBindParameter.git' - packages/NeonToYamlConverter: 'git@github.com:Symplify/NeonToYamlConverter.git' - packages/LatteToTwigConverter: 'git@github.com:Symplify/LatteToTwigConverter.git' packages/SmartFileSystem: 'git@github.com:Symplify/SmartFileSystem.git' packages/PackageBuilder: 'git@github.com:Symplify/PackageBuilder.git' packages/EasyCodingStandard: 'git@github.com:Symplify/EasyCodingStandard.git' diff --git a/packages/LatteToTwigConverter/.gitattributes b/packages/LatteToTwigConverter/.gitattributes deleted file mode 100644 index fdb17dcf92..0000000000 --- a/packages/LatteToTwigConverter/.gitattributes +++ /dev/null @@ -1,5 +0,0 @@ -.gitattributes export-ignore -.gitignore export-ignore -phpunit.xml export-ignore -*.md export-ignore -docs/ export-ignore diff --git a/packages/LatteToTwigConverter/.github/FUNDING.yml b/packages/LatteToTwigConverter/.github/FUNDING.yml deleted file mode 100644 index aa6662a85a..0000000000 --- a/packages/LatteToTwigConverter/.github/FUNDING.yml +++ /dev/null @@ -1,3 +0,0 @@ -# These are supported funding model platforms - -patreon: rectorphp diff --git a/packages/LatteToTwigConverter/.github/workflows/code_checks.yaml b/packages/LatteToTwigConverter/.github/workflows/code_checks.yaml deleted file mode 100644 index 4e1ddf47b7..0000000000 --- a/packages/LatteToTwigConverter/.github/workflows/code_checks.yaml +++ /dev/null @@ -1,40 +0,0 @@ -name: Code_Checks - -on: - push: - branches: - - master - -jobs: - tests: - runs-on: ubuntu-latest - strategy: - matrix: - php: ['7.2', '7.3', '7.4'] - - name: PHP ${{ matrix.php }} tests - steps: - - uses: actions/checkout@v2 - # see https://github.com/shivammathur/setup-php - - uses: shivammathur/setup-php@v1 - with: - php-version: ${{ matrix.php }} - coverage: none - - - run: composer install --no-progress - - run: vendor/bin/phpunit - - - name: Run Binary - run: bin/latte-to-twig-converter - - test_lowest_dependencies: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: shivammathur/setup-php@v1 - with: - php-version: 7.2 - coverage: none - - - run: composer update --no-progress --prefer-lowest - - run: vendor/bin/phpunit diff --git a/packages/LatteToTwigConverter/.gitignore b/packages/LatteToTwigConverter/.gitignore deleted file mode 100644 index dfd6caa431..0000000000 --- a/packages/LatteToTwigConverter/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/vendor -composer.lock \ No newline at end of file diff --git a/packages/LatteToTwigConverter/LICENSE b/packages/LatteToTwigConverter/LICENSE deleted file mode 100644 index 560a0b0a1a..0000000000 --- a/packages/LatteToTwigConverter/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -The MIT License ---------------- - -Copyright (c) 2018 Tomáš Votruba (http://tomasvotruba.cz) - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/packages/LatteToTwigConverter/README.md b/packages/LatteToTwigConverter/README.md deleted file mode 100644 index 220c9566f4..0000000000 --- a/packages/LatteToTwigConverter/README.md +++ /dev/null @@ -1,79 +0,0 @@ -# Latte to Twig Converter - -[![Build Status Github Actions](https://img.shields.io/github/workflow/status/Symplify/LatteToTwigConverter/Code_Checks?style=flat-square)](https://github.com/Symplify/LatteToTwigConverter/actions) -[![Downloads total](https://img.shields.io/packagist/dt/symplify/latte-to-twig-converter.svg?style=flat-square)](https://packagist.org/packages/symplify/latte-to-twig-converter/stats) - -Do you want to turn your [Latte](https://latte.nette.org/en/) templates to [Twig](https://twig.symfony.com/)? - -**Before** - -```html -{foreach $values as $key => $value} - {$value->getName()} - - {if isset($value['position'])} - {$value['position']|noescape} - {else} - {var $noPosition = true} - {/if} -{/foreach} -``` - -**After** - -```twig -{% for key, value in values %} - {{ value.getName() }} - - {% if value.position is defined %} - {{ value.position|raw }} - {% else %} - {% set noPosition = true %} - {% endif %} -{% endfor %} -``` - -And much more! - -This package won't do it all for you, but **it will help you with 80 % of the boring work**. - -## Install - -```bash -composer require symplify/latte-to-twig-converter --dev -``` - -## Usage - -It scan all the `*.twig`/`*.latte` files and converts to Twig with `*.twig`. - -```bash -vendor/bin/latte-to-twig-converter convert file.twig -vendor/bin/latte-to-twig-converter convert /directory -``` - -## Handle These Cases to Manually - -Some code doesn't have a clear path - you have more options in Twig, so better to migrate it manually. - -### `continueIf` - -```diff --{continueIf $cond} -+{% if cond %} --{$value} -+ {{ value }} -+{% endif %} -``` - -### `breakIf` - -```diff --{breakIf $cond} -+{% if cond === false %} --{$value} -+ {{ value }} -+{% endif %} -``` - -That's it :) diff --git a/packages/LatteToTwigConverter/bin/latte-to-twig-converter b/packages/LatteToTwigConverter/bin/latte-to-twig-converter deleted file mode 100755 index 43aa13c8c1..0000000000 --- a/packages/LatteToTwigConverter/bin/latte-to-twig-converter +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env php -boot(); - -$container = $latteToTwigConverterKernel->getContainer(); - -$application = $container->get(LatteToTwigConverterApplication::class); -exit($application->run()); diff --git a/packages/LatteToTwigConverter/composer.json b/packages/LatteToTwigConverter/composer.json deleted file mode 100644 index 96e789b99a..0000000000 --- a/packages/LatteToTwigConverter/composer.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "symplify/latte-to-twig-converter", - "description": "Latte to Twig converter converts Latte to Twig", - "license": "MIT", - "bin": [ - "bin/latte-to-twig-converter" - ], - "require": { - "php": "^7.2", - "nette/utils": "^3.0", - "symfony/dependency-injection": "^4.4|^5.0", - "symfony/console": "^4.4|^5.0", - "symfony/http-kernel": "^4.4|^5.0", - "symfony/finder": "^4.4|^5.0", - "symplify/package-builder": "^7.3", - "symplify/autowire-array-parameter": "^7.3", - "symplify/smart-file-system": "^7.3" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "autoload": { - "psr-4": { - "Symplify\\LatteToTwigConverter\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "Symplify\\LatteToTwigConverter\\Tests\\": "tests" - } - }, - "extra": { - "branch-alias": { - "dev-master": "7.3-dev" - } - }, - "minimum-stability": "dev", - "prefer-stable": true -} diff --git a/packages/LatteToTwigConverter/config/config.yaml b/packages/LatteToTwigConverter/config/config.yaml deleted file mode 100644 index 5b452f24e7..0000000000 --- a/packages/LatteToTwigConverter/config/config.yaml +++ /dev/null @@ -1,15 +0,0 @@ -services: - _defaults: - public: true - autowire: true - - Symplify\LatteToTwigConverter\: - resource: '../src' - exclude: - - '../src/Contract' - - '../src/Exception' - - '../src/HttpKernel/LatteToTwigConverterKernel.php' - - Symplify\PackageBuilder\Console\Style\SymfonyStyleFactory: ~ - Symplify\SmartFileSystem\Finder\FinderSanitizer: ~ - Symfony\Component\Filesystem\Filesystem: ~ diff --git a/packages/LatteToTwigConverter/phpunit.xml b/packages/LatteToTwigConverter/phpunit.xml deleted file mode 100644 index 1ad690939b..0000000000 --- a/packages/LatteToTwigConverter/phpunit.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - tests - - diff --git a/packages/LatteToTwigConverter/src/CaseConverter/BlockCaseConverter.php b/packages/LatteToTwigConverter/src/CaseConverter/BlockCaseConverter.php deleted file mode 100644 index 20f405ad73..0000000000 --- a/packages/LatteToTwigConverter/src/CaseConverter/BlockCaseConverter.php +++ /dev/null @@ -1,68 +0,0 @@ - - // {% block content %}...{% endblock %} - $content = Strings::replace($content, '#{block (\w+)}(.*?){\/block}#s', '{% block $1 %}$2{% endblock %}'); - // {include "_snippets/menu.latte"} => - // {% include "_snippets/menu.latte" %} - // {extends "_snippets/menu.latte"} => - // {% extends "_snippets/menu.latte" %} - $content = Strings::replace($content, '#{(include|extends) ([^}]+)}#', '{% $1 $2 %}'); - // {define sth}...{/define} => - // {% block sth %}...{% endblock %} - $content = Strings::replace($content, '#{define (.*?)}(.*?){\/define}#s', '{% block $1 %}$2{% endblock %}'); - - // include var: - // {% include "_snippets/menu.latte", "data" => $data %} => - // {% include "_snippets/menu.twig", { "data": data } %} - // see https://twig.symfony.com/doc/2.x/functions/include.html - // single lines - // ref https://regex101.com/r/uDJaia/1 - $content = Strings::replace($content, '#({% include .*?,)(.*?)(\s+%})#', function (array $match): string { - $variables = explode(',', $match[2]); - - $twigDataInString = ' { '; - $variableCount = count($variables); - foreach ($variables as $i => $variable) { - [ - $key, $value, - ] = explode('=>', $variable); - $key = trim($key); - $value = trim($value); - $value = ltrim($value, '$'); // variables do not start with - - $twigDataInString .= $key . ': ' . $value; - - // separator - if ($i < $variableCount - 1) { - $twigDataInString .= ', '; - } - } - - $twigDataInString .= ' }'; - - return $match[1] . $twigDataInString . $match[3]; - }); - - // {% include "sth", => - // {% include "sth" with - return Strings::replace($content, '#({% include [^,{}]+)(,)#', '$1 with'); - } -} diff --git a/packages/LatteToTwigConverter/src/CaseConverter/CaptureCaseConverter.php b/packages/LatteToTwigConverter/src/CaseConverter/CaptureCaseConverter.php deleted file mode 100644 index d3b669aeea..0000000000 --- a/packages/LatteToTwigConverter/src/CaseConverter/CaptureCaseConverter.php +++ /dev/null @@ -1,27 +0,0 @@ - - // {% set var = anotherVar %} - $content = Strings::replace($content, '#{var \$?(.*?) = \$?(.*?)}#s', '{% set $1 = $2 %}'); - - // {capture $var}...{/capture} => - // {% set var %}...{% endset %} - return Strings::replace($content, '#{capture \$(\w+)}(.*?){\/capture}#s', '{% set $1 %}$2{% endset %}'); - } -} diff --git a/packages/LatteToTwigConverter/src/CaseConverter/CommentCaseConverter.php b/packages/LatteToTwigConverter/src/CaseConverter/CommentCaseConverter.php deleted file mode 100644 index aaf9639ef2..0000000000 --- a/packages/LatteToTwigConverter/src/CaseConverter/CommentCaseConverter.php +++ /dev/null @@ -1,21 +0,0 @@ - - // {% if $post['variable'] is defined %}...{% endif %} - $content = Strings::replace( - $content, - '#{if isset\((.*?)\)}(.*?){\/if}#s', - '{% if $1 is defined %}$2{% endif %}' - ); - // {ifset $post}...{/ifset} => - // {% if $post is defined %}..{% endif %} - $content = Strings::replace($content, '#{ifset (.*?)}(.*?){\/ifset}#s', '{% if $1 is defined %}$2{% endif %}'); - - // {if "sth"}..{/if} => - // {% if "sth" %}..{% endif %} - // https://regex101.com/r/DrDSJf/1 - $content = Strings::replace($content, '#{if (.*?)}(.*?){\/if}#s', '{% if $1 %}$2{% endif %}'); - - $content = Strings::replace($content, '#{else}#', '{% else %}'); - - return Strings::replace($content, '#{elseif (.*?)}#', '{% elseif $1 %}'); - } -} diff --git a/packages/LatteToTwigConverter/src/CaseConverter/DateCaseConverter.php b/packages/LatteToTwigConverter/src/CaseConverter/DateCaseConverter.php deleted file mode 100644 index 9e5e1b9d67..0000000000 --- a/packages/LatteToTwigConverter/src/CaseConverter/DateCaseConverter.php +++ /dev/null @@ -1,21 +0,0 @@ - 'number_format', - ]; - - public function getPriority(): int - { - return 500; - } - - public function convertContent(string $content): string - { - // | noescape => - // | raw - $content = Strings::replace($content, '#\|(\s+)?noescape#', '|$1raw'); - - // {$value|date:'j. n. Y'} => - // {{ value|date('j. n. Y') }} - // {$11874|number:0:',':' '} - // {{ 11874|number_format(0, ',', ' ') }} - $content = Strings::replace($content, '#{(.*?)}#ms', function (array $match): string { - // has some filter with args? - if (! Strings::match($match[1], '#(.*?)\|(.*?):(.*?)#ms')) { - return $match[0]; - } - - // https://regex101.com/r/04QMgW/1 - $match[0] = Strings::replace($match[0], '#{(?.*)\|(?[a-z]+):(?(.*))[\n|\||}]#ms', function ( - array $subMatch - ): string { - // filter renames - $filterName = $this->filterRenames[$subMatch['filter']] ?? $subMatch['filter']; - $arguments = $this->replaceSeparator($subMatch['args']); - - $value = $subMatch['value']; - $value = ltrim($value, '$'); - - if ($filterName !== 'number_format') { - return sprintf('{{ %s|%s(%s) }}', $value, $filterName, $arguments); - } - - if ($this->shouldWrapNumber($value)) { - return sprintf('{{ (%s)|%s(%s) }}', $value, $filterName, $arguments); - } - - return sprintf('{{ %s|%s(%s) }}', $value, $filterName, $arguments); - }); - - return $match[0]; - }); - - // ... count(5) => - // ... 5|length - return Strings::replace($content, '#{(.*?) count\(\$?(\w+)\)(.*?)}#', '{$1 $2|length$3}'); - } - - private function replaceSeparator(string $arguments): string - { - return Strings::replace($arguments, '#:#', ', '); - } - - private function shouldWrapNumber(string $value): bool - { - return ! is_numeric($value); - } -} diff --git a/packages/LatteToTwigConverter/src/CaseConverter/IncludeToBlockCaseConverter.php b/packages/LatteToTwigConverter/src/CaseConverter/IncludeToBlockCaseConverter.php deleted file mode 100644 index 1f7ef5c3f5..0000000000 --- a/packages/LatteToTwigConverter/src/CaseConverter/IncludeToBlockCaseConverter.php +++ /dev/null @@ -1,21 +0,0 @@ - $value}...{/foreach} => - // {% for key, value in values %}...{% endfor %} - $content = Strings::replace( - $content, - '#{foreach \$?(.*?) as \$([()\w ]+) => \$(\w+)}#i', - '{% for $2, $3 in $1 %}' - ); - - // {foreach $values as [$value1, $value2]}...{/foreach} => - // {% for [value1, value2] in values %}...{% endfor %} - $content = Strings::replace( - $content, - '#{foreach \$?(?.*?) as (?\[.*?\])}#i', - function (array $match): string { - return sprintf('{%% for %s in %s %%}', str_replace('$', '', $match['items']), $match['list']); - } - ); - - // {foreach $values as $value}...{/foreach} => - // {% for value in values %}...{% endfor %} - $content = Strings::replace($content, '#{foreach \$?(.*?) as \$([()\w ]+)}#i', '{% for $2 in $1 %}'); - $content = Strings::replace($content, '#{/foreach}#', '{% endfor %}'); - - // {first}...{/first} => - // {% if loop.first %}...{% endif %} - $content = Strings::replace($content, '#{first}(.*?){/first}#msi', '{% if loop.first %}$1{% endif %}'); - - // {last}...{/last} => - // {% if loop.last %}...{% endif %} - $content = Strings::replace($content, '#{last}(.*?){/last}#msi', '{% if loop.last %}$1{% endif %}'); - - // {sep}, {/sep} => {% if loop.last == false %}, {% endif %} - return Strings::replace($content, '#{sep}(.*?){\/sep}#msi', '{% if loop.last == false %}$1{% endif %}'); - } -} diff --git a/packages/LatteToTwigConverter/src/CaseConverter/NClassMacroCaseConverter.php b/packages/LatteToTwigConverter/src/CaseConverter/NClassMacroCaseConverter.php deleted file mode 100644 index d80b3216d0..0000000000 --- a/packages/LatteToTwigConverter/src/CaseConverter/NClassMacroCaseConverter.php +++ /dev/null @@ -1,26 +0,0 @@ -(.*?))"#', - 'class="{% if $1 %}$2{% endif %}"' - ); - } -} diff --git a/packages/LatteToTwigConverter/src/CaseConverter/NMacrosCaseConverter.php b/packages/LatteToTwigConverter/src/CaseConverter/NMacrosCaseConverter.php deleted file mode 100644 index 8bd3c01d44..0000000000 --- a/packages/LatteToTwigConverter/src/CaseConverter/NMacrosCaseConverter.php +++ /dev/null @@ -1,109 +0,0 @@ -createPattern('if'), - function (array $match): string { - $eolChar = EolConfiguration::getEolChar(); - return sprintf( - '{if %s}%s%s%s%s%s%s{/if}', - $match['expression'], - $eolChar, - $match['openTagStart'], - $match['openTagEnd'], - $match['inner'], - $match['closeTag'], - $eolChar - ); - } - ); - - // n:ifset - $content = Strings::replace( - $content, - $this->createPattern('ifset'), - function (array $match): string { - $eolChar = EolConfiguration::getEolChar(); - return sprintf( - '{ifset %s}%s%s%s%s%s%s{/ifset}', - $match['expression'], - $eolChar, - $match['openTagStart'], - $match['openTagEnd'], - $match['inner'], - $match['closeTag'], - $eolChar - ); - } - ); - - // n:foreach - $content = Strings::replace( - $content, - $this->createPattern('foreach'), - function (array $match): string { - $eolChar = EolConfiguration::getEolChar(); - return sprintf( - '{foreach %s}%s%s%s%s%s%s{/foreach}', - $match['expression'], - $eolChar, - $match['openTagStart'], - $match['openTagEnd'], - $match['inner'], - $match['closeTag'], - $eolChar - ); - } - ); - - // n:inner-foreach - $content = Strings::replace( - $content, - $this->createPattern('inner-foreach'), - function (array $match): string { - $eolChar = EolConfiguration::getEolChar(); - return sprintf( - '%s%s%s{foreach %s}%s{/foreach}%s%s', - $match['openTagStart'], - $match['openTagEnd'], - $eolChar, - $match['expression'], - $match['inner'], - $eolChar, - $match['closeTag'] - ); - } - ); - - return $content; - } - - private function createPattern(string $macro): string - { - return '#(?<(?\w+)[^<]*?) n:' . $macro . '="(?.*?)"(?.*?>)(?.*?)(?<\/\2>)#sm'; - } -} diff --git a/packages/LatteToTwigConverter/src/CaseConverter/RenameMacroCaseConverter.php b/packages/LatteToTwigConverter/src/CaseConverter/RenameMacroCaseConverter.php deleted file mode 100644 index b5e8f35e3e..0000000000 --- a/packages/LatteToTwigConverter/src/CaseConverter/RenameMacroCaseConverter.php +++ /dev/null @@ -1,21 +0,0 @@ - "_snippets/menu.twig" - return Strings::replace($content, '#([\w/"]+).latte#', '$1.twig'); - } -} diff --git a/packages/LatteToTwigConverter/src/CaseConverter/VariableCaseConverter.php b/packages/LatteToTwigConverter/src/CaseConverter/VariableCaseConverter.php deleted file mode 100644 index 466fa96ffc..0000000000 --- a/packages/LatteToTwigConverter/src/CaseConverter/VariableCaseConverter.php +++ /dev/null @@ -1,97 +0,0 @@ -someMethodCall() - */ - private const PATTERN_METHOD_CALL = '->([\w\-\(\)]+)'; - - /** - * @var string - * - * Matches: - * ['someValue'] - */ - private const PATTERN_ARRAY_ACCESS = '\[\'([\w\-]+)\'\]'; - - public function getPriority(): int - { - return 200; - } - - public function convertContent(string $content): string - { - // quote in-script variables, they're auto-quoted by Latte - $content = Strings::replace($content, '#(.*?)#s', function (array $match): string { - $match[2] = Strings::replace($match[2], '#({\$(.*?)})#', '\'$1\''); - - return sprintf('%s', $match[1], $match[2]); - }); - - // {$post->getId()} => - // {{ post.getId() }} - $content = Strings::replace($content, '#{\$([\w-]+)' . self::PATTERN_METHOD_CALL . '(.*?)}#', '{{ $1.$2$3 }}'); - - // {$post['relativeUrl']} => - // {{ post.relativeUrl }} - $content = Strings::replace($content, '#{\$([\w-]+)' . self::PATTERN_ARRAY_ACCESS . '(.*?)}#', '{{ $1.$2$3 }}'); - - // { $post['relativeUrl'] } => - // { post.relativeUrl } - $content = Strings::replace( - $content, - '#{(.*?)\$?([\w-]+)' . self::PATTERN_ARRAY_ACCESS . '(.*?)}#', - '{$1$2.$3$4$5}' - ); - - // {$google_analytics_tracking_id} => - // {{ google_analytics_tracking_id }} - // {$google_analytics_tracking_id|someFilter} => - // {{ google_analytics_tracking_id|someFilter }} - $content = Strings::replace($content, '#{\$(\w+)(\|.*?)?}#', '{{ $1$2 }}'); - - // {11874|number(0:',':' ')} => - // {{ 11874|number(0:',':' ') }} - $content = Strings::replace($content, '#{(\d+)(\|.*?)}#', '{{ $1$2 }}'); - - return $this->processLoopAndConditionsVariables($content); - } - - private function processLoopAndConditionsVariables(string $content): string - { - // {... $variable->someMethodCall() ...} - // {... variable.someMethodCall() ...} - $content = Strings::replace( - $content, - '#{%(.*?)\$([\w-]+)' . self::PATTERN_METHOD_CALL . '(.*?)%}#', - '{%$1$2.$3$4%}' - ); - - // {... $variable['someKey'], $variable['anotherKey'] ...} - // {... variable.someKey, variable.anotherKey ...} - $content = Strings::replace( - $content, - '#{(.*?)}#', - function (array $match): string { - $match[1] = Strings::replace($match[1], '#' . self::PATTERN_ARRAY_ACCESS . '#', '.$1'); - - return '{' . $match[1] . '}'; - } - ); - - // {... $variable ...} - // {... variable ...} - return Strings::replace($content, '#{%(.*?)\$([\w-]+)(.*?)%}#', '{%$1$2$3%}'); - } -} diff --git a/packages/LatteToTwigConverter/src/Command/ConvertCommand.php b/packages/LatteToTwigConverter/src/Command/ConvertCommand.php deleted file mode 100644 index e2d33c9a50..0000000000 --- a/packages/LatteToTwigConverter/src/Command/ConvertCommand.php +++ /dev/null @@ -1,88 +0,0 @@ -latteToTwigConverter = $latteToTwigConverter; - $this->symfonyStyle = $symfonyStyle; - $this->latteAndTwigFinder = $latteAndTwigFinder; - } - - protected function configure(): void - { - $this->setName(CommandNaming::classToName(self::class)); - $this->addArgument(self::ARGUMENT_SOURCE, InputArgument::REQUIRED, 'Directory or file to convert'); - $this->setDescription('Converts Latte syntax to Twig'); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $source = (string) $input->getArgument(self::ARGUMENT_SOURCE); - $fileInfos = $this->latteAndTwigFinder->findTwigAndLatteFilesInSource($source); - - foreach ($fileInfos as $fileInfo) { - $convertedContent = $this->latteToTwigConverter->convertFile($fileInfo); - $oldFilePath = $fileInfo->getPathname(); - $newFilePath = Strings::replace($fileInfo->getPathname(), '#\.latte$#', '.twig'); - - // save - FileSystem::write($newFilePath, $convertedContent); - - // remove old path - if ($oldFilePath !== $newFilePath) { - FileSystem::delete($oldFilePath); - } - - $this->symfonyStyle->note(sprintf( - 'File "%s" was converted to Twig to "%s"', - $oldFilePath, - $newFilePath - )); - } - - $this->symfonyStyle->success('Done'); - - return ShellCode::SUCCESS; - } -} diff --git a/packages/LatteToTwigConverter/src/Console/LatteToTwigConverterApplication.php b/packages/LatteToTwigConverter/src/Console/LatteToTwigConverterApplication.php deleted file mode 100644 index ef85ea309d..0000000000 --- a/packages/LatteToTwigConverter/src/Console/LatteToTwigConverterApplication.php +++ /dev/null @@ -1,20 +0,0 @@ -addCommands($commands); - parent::__construct(); - } -} diff --git a/packages/LatteToTwigConverter/src/Contract/CaseConverter/CaseConverterInterface.php b/packages/LatteToTwigConverter/src/Contract/CaseConverter/CaseConverterInterface.php deleted file mode 100644 index 2b4b5ea9ce..0000000000 --- a/packages/LatteToTwigConverter/src/Contract/CaseConverter/CaseConverterInterface.php +++ /dev/null @@ -1,15 +0,0 @@ -finderSanitizer = $finderSanitizer; - } - - /** - * @return SmartFileInfo[] - */ - public function findTwigAndLatteFilesInSource(string $source): array - { - if (is_file($source) && file_exists($source)) { - return [new SmartFileInfo($source)]; - } - - $finder = Finder::create() - ->files() - ->in($source) - ->name('#\.(twig|latte)$#') - ->sortByName(); - - return $this->finderSanitizer->sanitize($finder); - } -} diff --git a/packages/LatteToTwigConverter/src/HttpKernel/LatteToTwigConverterKernel.php b/packages/LatteToTwigConverter/src/HttpKernel/LatteToTwigConverterKernel.php deleted file mode 100644 index 0620aeb4f8..0000000000 --- a/packages/LatteToTwigConverter/src/HttpKernel/LatteToTwigConverterKernel.php +++ /dev/null @@ -1,48 +0,0 @@ -load(__DIR__ . '/../../config/config.yaml'); - } - - public function getCacheDir(): string - { - return sys_get_temp_dir() . '/latte_to_twig_converter'; - } - - public function getLogDir(): string - { - return sys_get_temp_dir() . '/latte_to_twig_converter_log'; - } - - /** - * @return BundleInterface[] - */ - public function registerBundles(): iterable - { - return []; - } - - /** - * Order matters! - */ - protected function build(ContainerBuilder $containerBuilder): void - { - // needs to be first, since it's adding new service definitions - $containerBuilder->addCompilerPass(new AutoReturnFactoryCompilerPass()); - $containerBuilder->addCompilerPass(new AutowireArrayParameterCompilerPass()); - } -} diff --git a/packages/LatteToTwigConverter/src/LatteToTwigConverter.php b/packages/LatteToTwigConverter/src/LatteToTwigConverter.php deleted file mode 100644 index 55057f66aa..0000000000 --- a/packages/LatteToTwigConverter/src/LatteToTwigConverter.php +++ /dev/null @@ -1,54 +0,0 @@ -ensureCaseConverterPriorityIsUnique($caseConverter); - $this->caseConverters[$caseConverter->getPriority()] = $caseConverter; - } - - krsort($this->caseConverters); - } - - public function convertFile(SmartFileInfo $fileInfo): string - { - $content = $fileInfo->getContents(); - - foreach ($this->caseConverters as $caseConverter) { - $content = $caseConverter->convertContent($content); - } - - return $content; - } - - private function ensureCaseConverterPriorityIsUnique(CaseConverterInterface $caseConverter): void - { - if (! isset($this->caseConverters[$caseConverter->getPriority()])) { - return; - } - - throw new ConfigurationException(sprintf( - 'Duplicate case converter priority: %s and %s', - get_class($caseConverter), - get_class($this->caseConverters[$caseConverter->getPriority()]) - )); - } -} diff --git a/packages/LatteToTwigConverter/tests/ComplexSource/latte/arkadiuszkondas_default.latte b/packages/LatteToTwigConverter/tests/ComplexSource/latte/arkadiuszkondas_default.latte deleted file mode 100644 index b6b85339af..0000000000 --- a/packages/LatteToTwigConverter/tests/ComplexSource/latte/arkadiuszkondas_default.latte +++ /dev/null @@ -1,66 +0,0 @@ -{spaceless} - - - - - {include "_snippets/layout/title.latte"} - - - - {include "_snippets/layout/googleAnalytics.latte"} - - {* @link http://realfavicongenerator.net/ *} - - - - - {block meta}{/block} - - {include "_snippets/layout/styles.latte"} - - {block styles}{/block} - - - - -
-
- {ifset $title}

{$title}

{/ifset} - {block content}{/block} -
-
- - {block scripts}{/block} - {include "_snippets/layout/scripts.latte"} - - -{/spaceless} diff --git a/packages/LatteToTwigConverter/tests/ComplexSource/twig/arkadiuszkondas_default.twig b/packages/LatteToTwigConverter/tests/ComplexSource/twig/arkadiuszkondas_default.twig deleted file mode 100644 index 4201147ef7..0000000000 --- a/packages/LatteToTwigConverter/tests/ComplexSource/twig/arkadiuszkondas_default.twig +++ /dev/null @@ -1,66 +0,0 @@ -{% spaceless %} - - - - - {% include "_snippets/layout/title.twig" %} - - - - {% include "_snippets/layout/googleAnalytics.twig" %} - - {# @link http://realfavicongenerator.net/ #} - - - - - {% block meta %}{% endblock %} - - {% include "_snippets/layout/styles.twig" %} - - {% block styles %}{% endblock %} - - - - -
-
- {% if title is defined %}

{{ title }}

{% endif %} - {% block content %}{% endblock %} -
-
- - {% block scripts %}{% endblock %} - {% include "_snippets/layout/scripts.twig" %} - - -{% endspaceless %} diff --git a/packages/LatteToTwigConverter/tests/LatteToTwigConverterTest.php b/packages/LatteToTwigConverter/tests/LatteToTwigConverterTest.php deleted file mode 100644 index 6ca64f3f3b..0000000000 --- a/packages/LatteToTwigConverter/tests/LatteToTwigConverterTest.php +++ /dev/null @@ -1,87 +0,0 @@ -bootKernel(LatteToTwigConverterKernel::class); - $this->latteToTwigConverter = self::$container->get(LatteToTwigConverter::class); - } - - /** - * @dataProvider provideData() - * @dataProvider provideDataForNMacros() - * @dataProvider provideDataForFilters() - */ - public function test(string $latteFile, string $expectedTwigFile): void - { - $fileInfo = new SmartFileInfo($latteFile); - $convertedFile = $this->latteToTwigConverter->convertFile($fileInfo); - $this->assertStringEqualsFile($expectedTwigFile, $convertedFile, 'Caused in file: ' . $latteFile); - } - - public function provideData(): Iterator - { - yield [__DIR__ . '/Source/latte/date.latte', __DIR__ . '/Source/twig/date.twig']; - yield [__DIR__ . '/Source/latte/sprintf.latte', __DIR__ . '/Source/twig/sprintf.twig']; - - yield [__DIR__ . '/Source/latte/variables.latte', __DIR__ . '/Source/twig/variables.twig']; - yield [__DIR__ . '/Source/latte/block-file.latte', __DIR__ . '/Source/twig/block-file.twig']; - yield [__DIR__ . '/Source/latte/loops.latte', __DIR__ . '/Source/twig/loops.twig']; - yield [__DIR__ . '/Source/latte/conditions.latte', __DIR__ . '/Source/twig/conditions.twig']; - yield [__DIR__ . '/Source/latte/comment.latte', __DIR__ . '/Source/twig/comment.twig']; - yield [__DIR__ . '/Source/latte/capture.latte', __DIR__ . '/Source/twig/capture.twig']; - yield [__DIR__ . '/Source/latte/javascript.latte', __DIR__ . '/Source/twig/javascript.twig']; - - yield [__DIR__ . '/Source/latte/extends.latte', __DIR__ . '/Source/twig/extends.twig']; - yield [__DIR__ . '/Source/latte/default.latte', __DIR__ . '/Source/twig/default.twig']; - yield [__DIR__ . '/Source/latte/nested_variable.latte', __DIR__ . '/Source/twig/nested_variable.twig']; - yield [__DIR__ . '/Source/latte/first_last.latte', __DIR__ . '/Source/twig/first_last.twig']; - yield [__DIR__ . '/Source/latte/include.latte', __DIR__ . '/Source/twig/include.twig']; - yield [__DIR__ . '/Source/latte/spaceless.latte', __DIR__ . '/Source/twig/spaceless.twig']; - - // complex - yield [ - __DIR__ . '/ComplexSource/latte/arkadiuszkondas_default.latte', - __DIR__ . '/ComplexSource/twig/arkadiuszkondas_default.twig', - ]; - } - - public function provideDataForNMacros(): Iterator - { - yield [ - __DIR__ . '/Source/latte/n-macro/n-inner-foreach.latte', - __DIR__ . '/Source/twig/n-macro/n-inner-foreach.twig', - ]; - yield [__DIR__ . '/Source/latte/n-macro/n-if.latte', __DIR__ . '/Source/twig/n-macro/n-if.twig']; - yield [__DIR__ . '/Source/latte/n-macro/n-ifset.latte', __DIR__ . '/Source/twig/n-macro/n-ifset.twig']; - yield [__DIR__ . '/Source/latte/n-macro/n-foreach.latte', __DIR__ . '/Source/twig/n-macro/n-foreach.twig']; - - yield [__DIR__ . '/Source/latte/n-macro/n-class.latte', __DIR__ . '/Source/twig/n-macro/n-class.twig']; - } - - public function provideDataForFilters(): Iterator - { - yield [__DIR__ . '/Source/latte/filter.latte', __DIR__ . '/Source/twig/filter.twig']; - yield [ - __DIR__ . '/Source/latte/filter_with_arguments.latte', - __DIR__ . '/Source/twig/filter_with_arguments.twig', - ]; - yield [__DIR__ . '/Source/latte/filter_with_number.latte', __DIR__ . '/Source/twig/filter_with_number.twig']; - } -} diff --git a/packages/LatteToTwigConverter/tests/Source/latte/block-file.latte b/packages/LatteToTwigConverter/tests/Source/latte/block-file.latte deleted file mode 100644 index 73ed6e410b..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/latte/block-file.latte +++ /dev/null @@ -1,19 +0,0 @@ -{block content} - - Content - -{/block} - - -{include "_snippets/menu.latte"} - -{include "_snippets/menu.latte", "key" => "var"} - -{include "_snippets/lecture/lectureReference.latte", "lecture_reference" => $lecture_reference, "active_lecture" => $lecture, "is_lecture_detail" => true} - - -{define someBlock} - - Hi - -{/define} diff --git a/packages/LatteToTwigConverter/tests/Source/latte/capture.latte b/packages/LatteToTwigConverter/tests/Source/latte/capture.latte deleted file mode 100644 index f739f4b290..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/latte/capture.latte +++ /dev/null @@ -1,6 +0,0 @@ -{var $var = $anotherVar} - - -{capture $var} - ... -{/capture} diff --git a/packages/LatteToTwigConverter/tests/Source/latte/comment.latte b/packages/LatteToTwigConverter/tests/Source/latte/comment.latte deleted file mode 100644 index bf2706729f..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/latte/comment.latte +++ /dev/null @@ -1,7 +0,0 @@ -{*hidden*} - -{* hidden *} - -{* -hidden -*} diff --git a/packages/LatteToTwigConverter/tests/Source/latte/conditions.latte b/packages/LatteToTwigConverter/tests/Source/latte/conditions.latte deleted file mode 100644 index 2faa0fd831..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/latte/conditions.latte +++ /dev/null @@ -1,18 +0,0 @@ -{if isset($post['variable'])}...{/if} - - -{ifset $post}...{/ifset} - - -{if $post['deprecated']} - -{/if} - - -{if true} - -{elseif false} - -{else} - -{/if} diff --git a/packages/LatteToTwigConverter/tests/Source/latte/date.latte b/packages/LatteToTwigConverter/tests/Source/latte/date.latte deleted file mode 100644 index 18214314b8..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/latte/date.latte +++ /dev/null @@ -1 +0,0 @@ -{var $today = date('Y-m-d')} \ No newline at end of file diff --git a/packages/LatteToTwigConverter/tests/Source/latte/default.latte b/packages/LatteToTwigConverter/tests/Source/latte/default.latte deleted file mode 100644 index d7bf644ee0..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/latte/default.latte +++ /dev/null @@ -1,2 +0,0 @@ -{default $showReadingTime = true} -{default $showCommentsCount = $post['showCommentsCount'] ?? true} diff --git a/packages/LatteToTwigConverter/tests/Source/latte/extends.latte b/packages/LatteToTwigConverter/tests/Source/latte/extends.latte deleted file mode 100644 index f7e3e3a367..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/latte/extends.latte +++ /dev/null @@ -1 +0,0 @@ -{extends "_layouts/default.latte"} diff --git a/packages/LatteToTwigConverter/tests/Source/latte/filter.latte b/packages/LatteToTwigConverter/tests/Source/latte/filter.latte deleted file mode 100644 index c073ee2423..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/latte/filter.latte +++ /dev/null @@ -1,8 +0,0 @@ -{$post['updated_message']|someFilter} - -{$post|noescape} -{$post| noescape} - -{$post|someComplexFilter: "one", "two"} - -{if count(5)}...{/if} \ No newline at end of file diff --git a/packages/LatteToTwigConverter/tests/Source/latte/filter_with_arguments.latte b/packages/LatteToTwigConverter/tests/Source/latte/filter_with_arguments.latte deleted file mode 100644 index 96b433daa9..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/latte/filter_with_arguments.latte +++ /dev/null @@ -1,3 +0,0 @@ -{$value|date:'j. n. Y'} - -{$post['description']|striptags|replace:'"','\"'} diff --git a/packages/LatteToTwigConverter/tests/Source/latte/filter_with_number.latte b/packages/LatteToTwigConverter/tests/Source/latte/filter_with_number.latte deleted file mode 100644 index fe6109f628..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/latte/filter_with_number.latte +++ /dev/null @@ -1,3 +0,0 @@ -{11874|number:0:',':' '} - -{11874*2/60/60|number:0:',':' '} hodin diff --git a/packages/LatteToTwigConverter/tests/Source/latte/first_last.latte b/packages/LatteToTwigConverter/tests/Source/latte/first_last.latte deleted file mode 100644 index 2c922dc33b..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/latte/first_last.latte +++ /dev/null @@ -1,5 +0,0 @@ -{first}{{ post.getDateInFormat('r') }}{/first} - -{last} - {{ post.getDateInFormat('r') }} -{/last} diff --git a/packages/LatteToTwigConverter/tests/Source/latte/include.latte b/packages/LatteToTwigConverter/tests/Source/latte/include.latte deleted file mode 100644 index c341890926..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/latte/include.latte +++ /dev/null @@ -1,2 +0,0 @@ -{include "_snippets/layout/title.latte"} - diff --git a/packages/LatteToTwigConverter/tests/Source/latte/javascript.latte b/packages/LatteToTwigConverter/tests/Source/latte/javascript.latte deleted file mode 100644 index c5cf4cb996..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/latte/javascript.latte +++ /dev/null @@ -1,8 +0,0 @@ - - - diff --git a/packages/LatteToTwigConverter/tests/Source/latte/loops.latte b/packages/LatteToTwigConverter/tests/Source/latte/loops.latte deleted file mode 100644 index 87a4f45a08..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/latte/loops.latte +++ /dev/null @@ -1,14 +0,0 @@ -{sep}, {/sep} - - -{foreach $values as $key => $value} - ... -{/foreach} - -{foreach $values as $value} - ... -{/foreach} - -{foreach $values['items'] as $key => $value} - ... -{/foreach} diff --git a/packages/LatteToTwigConverter/tests/Source/latte/n-macro/n-class.latte b/packages/LatteToTwigConverter/tests/Source/latte/n-macro/n-class.latte deleted file mode 100644 index 1a69e56290..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/latte/n-macro/n-class.latte +++ /dev/null @@ -1 +0,0 @@ -
  • item
  • diff --git a/packages/LatteToTwigConverter/tests/Source/latte/n-macro/n-foreach.latte b/packages/LatteToTwigConverter/tests/Source/latte/n-macro/n-foreach.latte deleted file mode 100644 index ce91d9ff1b..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/latte/n-macro/n-foreach.latte +++ /dev/null @@ -1,3 +0,0 @@ -
  • - inner -
  • diff --git a/packages/LatteToTwigConverter/tests/Source/latte/n-macro/n-if.latte b/packages/LatteToTwigConverter/tests/Source/latte/n-macro/n-if.latte deleted file mode 100644 index 95c930f676..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/latte/n-macro/n-if.latte +++ /dev/null @@ -1 +0,0 @@ -{$reference['author']} diff --git a/packages/LatteToTwigConverter/tests/Source/latte/n-macro/n-ifset.latte b/packages/LatteToTwigConverter/tests/Source/latte/n-macro/n-ifset.latte deleted file mode 100644 index 73ce8010dc..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/latte/n-macro/n-ifset.latte +++ /dev/null @@ -1 +0,0 @@ -{$reference['author']} diff --git a/packages/LatteToTwigConverter/tests/Source/latte/n-macro/n-inner-foreach.latte b/packages/LatteToTwigConverter/tests/Source/latte/n-macro/n-inner-foreach.latte deleted file mode 100644 index d2cfa36c16..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/latte/n-macro/n-inner-foreach.latte +++ /dev/null @@ -1,6 +0,0 @@ -
    -

    Sources

    - -
    diff --git a/packages/LatteToTwigConverter/tests/Source/latte/nested_variable.latte b/packages/LatteToTwigConverter/tests/Source/latte/nested_variable.latte deleted file mode 100644 index 05e2090def..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/latte/nested_variable.latte +++ /dev/null @@ -1,9 +0,0 @@ -{var $url = sprintf("%s/%s", $site['url'], $post['relativeUrl'])} - -{var $url = $post['external']} - -{var $appendix = $site['title'] . ' | ' . $site['subtitle']} - -{include "_snippets/layout/image.latte", src => $project['image'], url => $project['repository'], alt => $project['name']} - -{$page['training']['phpstorm']['date']|date:'j. n. Y'} diff --git a/packages/LatteToTwigConverter/tests/Source/latte/spaceless.latte b/packages/LatteToTwigConverter/tests/Source/latte/spaceless.latte deleted file mode 100644 index 6faaa9397d..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/latte/spaceless.latte +++ /dev/null @@ -1,3 +0,0 @@ -{spaceless} -... -{/spaceless} diff --git a/packages/LatteToTwigConverter/tests/Source/latte/sprintf.latte b/packages/LatteToTwigConverter/tests/Source/latte/sprintf.latte deleted file mode 100644 index 92b670186a..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/latte/sprintf.latte +++ /dev/null @@ -1 +0,0 @@ -{var $url = sprintf("%s/%s", a, b)} diff --git a/packages/LatteToTwigConverter/tests/Source/latte/variables.latte b/packages/LatteToTwigConverter/tests/Source/latte/variables.latte deleted file mode 100644 index 3afab6f91a..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/latte/variables.latte +++ /dev/null @@ -1,19 +0,0 @@ -{$value} - -{$another_value} - -{$post['relativeUrl']} - -{$post->getId()} - - -{if $lecture}...{/if}: - - -{if $lecture->isInEnglish()}...{/if}: - - -{if $lecture['english']}...{/if}: - - -{if $lecture->isInReferences($lecture_references)}...{/if} \ No newline at end of file diff --git a/packages/LatteToTwigConverter/tests/Source/twig/block-file.twig b/packages/LatteToTwigConverter/tests/Source/twig/block-file.twig deleted file mode 100644 index da35792626..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/twig/block-file.twig +++ /dev/null @@ -1,19 +0,0 @@ -{% block content %} - - Content - -{% endblock %} - - -{% include "_snippets/menu.twig" %} - -{% include "_snippets/menu.twig" with { "key": "var" } %} - -{% include "_snippets/lecture/lectureReference.twig" with { "lecture_reference": lecture_reference, "active_lecture": lecture, "is_lecture_detail": true } %} - - -{% block someBlock %} - - Hi - -{% endblock %} diff --git a/packages/LatteToTwigConverter/tests/Source/twig/capture.twig b/packages/LatteToTwigConverter/tests/Source/twig/capture.twig deleted file mode 100644 index b5f453fe46..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/twig/capture.twig +++ /dev/null @@ -1,6 +0,0 @@ -{% set var = anotherVar %} - - -{% set var %} - ... -{% endset %} diff --git a/packages/LatteToTwigConverter/tests/Source/twig/comment.twig b/packages/LatteToTwigConverter/tests/Source/twig/comment.twig deleted file mode 100644 index aae823250e..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/twig/comment.twig +++ /dev/null @@ -1,7 +0,0 @@ -{#hidden#} - -{# hidden #} - -{# -hidden -#} diff --git a/packages/LatteToTwigConverter/tests/Source/twig/conditions.twig b/packages/LatteToTwigConverter/tests/Source/twig/conditions.twig deleted file mode 100644 index 9a072711fc..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/twig/conditions.twig +++ /dev/null @@ -1,18 +0,0 @@ -{% if post.variable is defined %}...{% endif %} - - -{% if post is defined %}...{% endif %} - - -{% if post.deprecated %} - -{% endif %} - - -{% if true %} - -{% elseif false %} - -{% else %} - -{% endif %} diff --git a/packages/LatteToTwigConverter/tests/Source/twig/date.twig b/packages/LatteToTwigConverter/tests/Source/twig/date.twig deleted file mode 100644 index 851bd2c623..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/twig/date.twig +++ /dev/null @@ -1 +0,0 @@ -{% set today = "now"|date('Y-m-d') %} \ No newline at end of file diff --git a/packages/LatteToTwigConverter/tests/Source/twig/default.twig b/packages/LatteToTwigConverter/tests/Source/twig/default.twig deleted file mode 100644 index 22c82598c9..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/twig/default.twig +++ /dev/null @@ -1,2 +0,0 @@ -{% if showReadingTime is not defined %}{% set showReadingTime = true %}{% endif %} -{% if showCommentsCount is not defined %}{% set showCommentsCount = post.showCommentsCount ?? true %}{% endif %} diff --git a/packages/LatteToTwigConverter/tests/Source/twig/extends.twig b/packages/LatteToTwigConverter/tests/Source/twig/extends.twig deleted file mode 100644 index 5381462257..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/twig/extends.twig +++ /dev/null @@ -1 +0,0 @@ -{% extends "_layouts/default.twig" %} diff --git a/packages/LatteToTwigConverter/tests/Source/twig/filter.twig b/packages/LatteToTwigConverter/tests/Source/twig/filter.twig deleted file mode 100644 index 071c47cdd3..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/twig/filter.twig +++ /dev/null @@ -1,8 +0,0 @@ -{{ post.updated_message|someFilter }} - -{{ post|raw }} -{{ post| raw }} - -{{ post|someComplexFilter: "one", "two" }} - -{% if 5|length %}...{% endif %} \ No newline at end of file diff --git a/packages/LatteToTwigConverter/tests/Source/twig/filter_with_arguments.twig b/packages/LatteToTwigConverter/tests/Source/twig/filter_with_arguments.twig deleted file mode 100644 index da323de3e4..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/twig/filter_with_arguments.twig +++ /dev/null @@ -1,3 +0,0 @@ -{{ value|date('j. n. Y') }} - -{{ post.description|striptags|replace('"','\"') }} diff --git a/packages/LatteToTwigConverter/tests/Source/twig/filter_with_number.twig b/packages/LatteToTwigConverter/tests/Source/twig/filter_with_number.twig deleted file mode 100644 index 5228425c96..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/twig/filter_with_number.twig +++ /dev/null @@ -1,3 +0,0 @@ -{{ 11874|number_format(0, ',', ' ') }} - -{{ (11874*2/60/60)|number_format(0, ',', ' ') }} hodin diff --git a/packages/LatteToTwigConverter/tests/Source/twig/first_last.twig b/packages/LatteToTwigConverter/tests/Source/twig/first_last.twig deleted file mode 100644 index bb1137457d..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/twig/first_last.twig +++ /dev/null @@ -1,5 +0,0 @@ -{% if loop.first %}{{ post.getDateInFormat('r') }}{% endif %} - -{% if loop.last %} - {{ post.getDateInFormat('r') }} -{% endif %} diff --git a/packages/LatteToTwigConverter/tests/Source/twig/include.twig b/packages/LatteToTwigConverter/tests/Source/twig/include.twig deleted file mode 100644 index a09adf6056..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/twig/include.twig +++ /dev/null @@ -1,2 +0,0 @@ -{% include "_snippets/layout/title.twig" %} - diff --git a/packages/LatteToTwigConverter/tests/Source/twig/javascript.twig b/packages/LatteToTwigConverter/tests/Source/twig/javascript.twig deleted file mode 100644 index 90486a4e2a..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/twig/javascript.twig +++ /dev/null @@ -1,8 +0,0 @@ - - - diff --git a/packages/LatteToTwigConverter/tests/Source/twig/loops.twig b/packages/LatteToTwigConverter/tests/Source/twig/loops.twig deleted file mode 100644 index ffdd6e5e31..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/twig/loops.twig +++ /dev/null @@ -1,14 +0,0 @@ -{% if loop.last == false %}, {% endif %} - - -{% for key, value in values %} - ... -{% endfor %} - -{% for value in values %} - ... -{% endfor %} - -{% for key, value in values.items %} - ... -{% endfor %} diff --git a/packages/LatteToTwigConverter/tests/Source/twig/n-macro/n-class.twig b/packages/LatteToTwigConverter/tests/Source/twig/n-macro/n-class.twig deleted file mode 100644 index 28b2899573..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/twig/n-macro/n-class.twig +++ /dev/null @@ -1 +0,0 @@ -
  • item
  • diff --git a/packages/LatteToTwigConverter/tests/Source/twig/n-macro/n-foreach.twig b/packages/LatteToTwigConverter/tests/Source/twig/n-macro/n-foreach.twig deleted file mode 100644 index 54e9d58f85..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/twig/n-macro/n-foreach.twig +++ /dev/null @@ -1,5 +0,0 @@ -{% for reference in page.training.phpstorm.references %} -
  • - inner -
  • -{% endfor %} diff --git a/packages/LatteToTwigConverter/tests/Source/twig/n-macro/n-if.twig b/packages/LatteToTwigConverter/tests/Source/twig/n-macro/n-if.twig deleted file mode 100644 index 28b68f9e84..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/twig/n-macro/n-if.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% if reference.author is defined %} -{{ reference.author }} -{% endif %} diff --git a/packages/LatteToTwigConverter/tests/Source/twig/n-macro/n-ifset.twig b/packages/LatteToTwigConverter/tests/Source/twig/n-macro/n-ifset.twig deleted file mode 100644 index 28b68f9e84..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/twig/n-macro/n-ifset.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% if reference.author is defined %} -{{ reference.author }} -{% endif %} diff --git a/packages/LatteToTwigConverter/tests/Source/twig/n-macro/n-inner-foreach.twig b/packages/LatteToTwigConverter/tests/Source/twig/n-macro/n-inner-foreach.twig deleted file mode 100644 index 6ffd19637a..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/twig/n-macro/n-inner-foreach.twig +++ /dev/null @@ -1,10 +0,0 @@ -{% if sources is defined %} -
    -

    Sources

    -
      -{% for [link, title] in sources %} -
    • {{ title }}
    • - {% endfor %} -
    -
    -{% endif %} diff --git a/packages/LatteToTwigConverter/tests/Source/twig/nested_variable.twig b/packages/LatteToTwigConverter/tests/Source/twig/nested_variable.twig deleted file mode 100644 index 04af7e5edf..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/twig/nested_variable.twig +++ /dev/null @@ -1,9 +0,0 @@ -{% set url = "%s/%s"|format(site.url, post.relativeUrl) %} - -{% set url = post.external %} - -{% set appendix = site.title . ' | ' . site.subtitle %} - -{% include "_snippets/layout/image.twig" with { src: project.image, url: project.repository, alt: project.name } %} - -{{ page.training.phpstorm.date|date('j. n. Y') }} diff --git a/packages/LatteToTwigConverter/tests/Source/twig/spaceless.twig b/packages/LatteToTwigConverter/tests/Source/twig/spaceless.twig deleted file mode 100644 index abdeee041f..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/twig/spaceless.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% spaceless %} -... -{% endspaceless %} diff --git a/packages/LatteToTwigConverter/tests/Source/twig/sprintf.twig b/packages/LatteToTwigConverter/tests/Source/twig/sprintf.twig deleted file mode 100644 index a9672fdcdd..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/twig/sprintf.twig +++ /dev/null @@ -1 +0,0 @@ -{% set url = "%s/%s"|format(a, b) %} diff --git a/packages/LatteToTwigConverter/tests/Source/twig/variables.twig b/packages/LatteToTwigConverter/tests/Source/twig/variables.twig deleted file mode 100644 index 8072ef9f47..0000000000 --- a/packages/LatteToTwigConverter/tests/Source/twig/variables.twig +++ /dev/null @@ -1,19 +0,0 @@ -{{ value }} - -{{ another_value }} - -{{ post.relativeUrl }} - -{{ post.getId() }} - - -{% if lecture %}...{% endif %}: - - -{% if lecture.isInEnglish() %}...{% endif %}: - - -{% if lecture.english %}...{% endif %}: - - -{% if lecture.isInReferences(lecture_references) %}...{% endif %} \ No newline at end of file diff --git a/packages/NeonToYamlConverter/.gitattributes b/packages/NeonToYamlConverter/.gitattributes deleted file mode 100644 index fdb17dcf92..0000000000 --- a/packages/NeonToYamlConverter/.gitattributes +++ /dev/null @@ -1,5 +0,0 @@ -.gitattributes export-ignore -.gitignore export-ignore -phpunit.xml export-ignore -*.md export-ignore -docs/ export-ignore diff --git a/packages/NeonToYamlConverter/.github/FUNDING.yml b/packages/NeonToYamlConverter/.github/FUNDING.yml deleted file mode 100644 index aa6662a85a..0000000000 --- a/packages/NeonToYamlConverter/.github/FUNDING.yml +++ /dev/null @@ -1,3 +0,0 @@ -# These are supported funding model platforms - -patreon: rectorphp diff --git a/packages/NeonToYamlConverter/.github/workflows/code_checks.yaml b/packages/NeonToYamlConverter/.github/workflows/code_checks.yaml deleted file mode 100644 index b6e07d4f0b..0000000000 --- a/packages/NeonToYamlConverter/.github/workflows/code_checks.yaml +++ /dev/null @@ -1,40 +0,0 @@ -name: Code_Checks - -on: - push: - branches: - - master - -jobs: - tests: - runs-on: ubuntu-latest - strategy: - matrix: - php: ['7.2', '7.3', '7.4'] - - name: PHP ${{ matrix.php }} tests - steps: - - uses: actions/checkout@v2 - # see https://github.com/shivammathur/setup-php - - uses: shivammathur/setup-php@v1 - with: - php-version: ${{ matrix.php }} - coverage: none - - - run: composer install --no-progress - - run: vendor/bin/phpunit - - - name: Run Binary - run: bin/neon-to-yaml-converter - - test_lowest_dependencies: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: shivammathur/setup-php@v1 - with: - php-version: 7.2 - coverage: none - - - run: composer update --no-progress --prefer-lowest - - run: vendor/bin/phpunit diff --git a/packages/NeonToYamlConverter/.gitignore b/packages/NeonToYamlConverter/.gitignore deleted file mode 100644 index dfd6caa431..0000000000 --- a/packages/NeonToYamlConverter/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/vendor -composer.lock \ No newline at end of file diff --git a/packages/NeonToYamlConverter/LICENSE b/packages/NeonToYamlConverter/LICENSE deleted file mode 100644 index 560a0b0a1a..0000000000 --- a/packages/NeonToYamlConverter/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -The MIT License ---------------- - -Copyright (c) 2018 Tomáš Votruba (http://tomasvotruba.cz) - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/packages/NeonToYamlConverter/README.md b/packages/NeonToYamlConverter/README.md deleted file mode 100644 index 1674a4ed58..0000000000 --- a/packages/NeonToYamlConverter/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# Neon to Yaml Converter - -[![Build Status Github Actions](https://img.shields.io/github/workflow/status/Symplify/NeonToYamlConverter/Code_Checks?style=flat-square)](https://github.com/Symplify/NeonToYamlConverter/actions) -[![Downloads total](https://img.shields.io/packagist/dt/symplify/neon-to-yaml-converter.svg?style=flat-square)](https://packagist.org/packages/symplify/neon-to-yaml-converter/stats) - -Do you want to turn your [Neon](https://ne-on.org/) templates to [Yaml](https://symfony.com/doc/current/components/yaml.html)? There are [many differences](https://www.tomasvotruba.cz/blog/2018/03/12/neon-vs-yaml-and-how-to-migrate-between-them/) you need to watch out for. - -This tool automates it :) - -**Before** - -```yaml -includes: - - another-config.neon - -parameters: - perex: ''' - This is long multiline perex, -that takes too much space. -''' - -services: - - App\SomeService(@anotherService, %perex%) -``` - -**After** - -```yaml -imports: - - { resource: another-config.yaml } - -parameters: - perex: | - This is long multiline perex, - that takes too much space. - -services: - App\SomeService: - arguments: - - '@anotherService' - - '%perex%' -``` - -And much more! - -This package won't do it all for you, but **it will help you with 90 % of the boring work**. - -## Install - -```bash -composer require symplify/neon-to-yaml-converter --dev -``` - -## Usage - -It scan all the `*.(yml|yaml|neon)` files and converts Neon syntax to Yaml and `*.yaml` file. - -```bash -vendor/bin/neon-to-yaml-converter convert file.neon -vendor/bin/neon-to-yaml-converter convert /directory -``` - -That's it :) diff --git a/packages/NeonToYamlConverter/bin/neon-to-yaml-converter b/packages/NeonToYamlConverter/bin/neon-to-yaml-converter deleted file mode 100755 index 2c1af93770..0000000000 --- a/packages/NeonToYamlConverter/bin/neon-to-yaml-converter +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env php -boot(); -$container = $neonToYamlConverterKernel->getContainer(); - -# 3. run it -$application = $container->get(NeonToYamlConverterApplication::class); -exit($application->run()); diff --git a/packages/NeonToYamlConverter/composer.json b/packages/NeonToYamlConverter/composer.json deleted file mode 100644 index 3836383d39..0000000000 --- a/packages/NeonToYamlConverter/composer.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "symplify/neon-to-yaml-converter", - "description": "Converts Neon to Yaml", - "license": "MIT", - "bin": [ - "bin/neon-to-yaml-converter" - ], - "require": { - "php": "^7.2", - "nette/utils": "^3.0", - "nette/neon": "^3.0", - "symplify/package-builder": "^7.3", - "symplify/smart-file-system": "^7.3", - "symplify/autowire-array-parameter": "^7.3", - "symfony/http-kernel": "^4.4|^5.0", - "symfony/yaml": "^4.4|^5.0" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "autoload": { - "psr-4": { - "Symplify\\NeonToYamlConverter\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "Symplify\\NeonToYamlConverter\\Tests\\": "tests" - } - }, - "extra": { - "branch-alias": { - "dev-master": "7.3-dev" - } - }, - "minimum-stability": "dev", - "prefer-stable": true -} diff --git a/packages/NeonToYamlConverter/config/config.yaml b/packages/NeonToYamlConverter/config/config.yaml deleted file mode 100644 index 4d185df57a..0000000000 --- a/packages/NeonToYamlConverter/config/config.yaml +++ /dev/null @@ -1,15 +0,0 @@ -services: - _defaults: - public: true - autowire: true - - Symplify\NeonToYamlConverter\: - resource: '../src' - exclude: - - '../src/HttpKernel/NeonToYamlConverterKernel.php' - - Symfony\Component\Filesystem\Filesystem: ~ - - Symplify\PackageBuilder\Console\Style\SymfonyStyleFactory: ~ - Symplify\SmartFileSystem\Finder\FinderSanitizer: ~ - Symplify\PackageBuilder\Strings\StringFormatConverter: ~ diff --git a/packages/NeonToYamlConverter/phpunit.xml b/packages/NeonToYamlConverter/phpunit.xml deleted file mode 100644 index 1ad690939b..0000000000 --- a/packages/NeonToYamlConverter/phpunit.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - tests - - diff --git a/packages/NeonToYamlConverter/src/ArrayParameterCollector.php b/packages/NeonToYamlConverter/src/ArrayParameterCollector.php deleted file mode 100644 index ebac97d959..0000000000 --- a/packages/NeonToYamlConverter/src/ArrayParameterCollector.php +++ /dev/null @@ -1,58 +0,0 @@ -stringFormatConverter = $stringFormatConverter; - } - - /** - * @return string[] - */ - public function getParametersToReplace(): array - { - return $this->parametersToReplace; - } - - /** - * @param SmartFileInfo[] $fileInfos - */ - public function collectFromFiles(array $fileInfos): void - { - foreach ($fileInfos as $fileInfo) { - $content = $fileInfo->getContents(); - $matches = Strings::matchAll($content, '#%(?\w+\.\w+)%#'); - - foreach ($matches as $match) { - $oldKey = $match['param_name']; - $newKey = $this->stringFormatConverter->camelCaseToUnderscore($oldKey); - - $this->parametersToReplace[$oldKey] = $newKey; - } - } - } - - public function matchParameterToReplace(string $key): ?string - { - return $this->parametersToReplace[$key] ?? null; - } -} diff --git a/packages/NeonToYamlConverter/src/Command/ConvertCommand.php b/packages/NeonToYamlConverter/src/Command/ConvertCommand.php deleted file mode 100644 index d522d082ff..0000000000 --- a/packages/NeonToYamlConverter/src/Command/ConvertCommand.php +++ /dev/null @@ -1,98 +0,0 @@ -symfonyStyle = $symfonyStyle; - $this->neonToYamlConverter = $neonToYamlConverter; - $this->neonAndYamlFinder = $neonAndYamlFinder; - $this->arrayParameterCollector = $arrayParameterCollector; - } - - protected function configure(): void - { - $this->setName(CommandNaming::classToName(self::class)); - $this->addArgument(self::ARGUMENT_SOURCE, InputArgument::REQUIRED, 'Directory or file to convert'); - $this->setDescription('Converts Neon syntax to Yaml'); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $source = (string) $input->getArgument(self::ARGUMENT_SOURCE); - $fileInfos = $this->neonAndYamlFinder->findYamlAndNeonFilesInfSource($source); - - $this->arrayParameterCollector->collectFromFiles($fileInfos); - - foreach ($fileInfos as $fileInfo) { - $convertedContent = $this->neonToYamlConverter->convertFile($fileInfo); - $oldFilePath = $fileInfo->getPathname(); - $newFilePath = Strings::replace($oldFilePath, '#\.neon$#', '.yaml'); - - // save - FileSystem::write($newFilePath, $convertedContent); - - // remove old path - if ($oldFilePath !== $newFilePath) { - FileSystem::delete($oldFilePath); - } - - $this->symfonyStyle->note(sprintf( - 'File "%s" was converted to YAML to "%s" path', - $oldFilePath, - $newFilePath - )); - } - - $this->symfonyStyle->success('Done'); - - return ShellCode::SUCCESS; - } -} diff --git a/packages/NeonToYamlConverter/src/Console/NeonToYamlConverterApplication.php b/packages/NeonToYamlConverter/src/Console/NeonToYamlConverterApplication.php deleted file mode 100644 index 96085c902f..0000000000 --- a/packages/NeonToYamlConverter/src/Console/NeonToYamlConverterApplication.php +++ /dev/null @@ -1,20 +0,0 @@ -addCommands($commands); - parent::__construct(); - } -} diff --git a/packages/NeonToYamlConverter/src/ConverterWorker/ParameterConverterWorker.php b/packages/NeonToYamlConverter/src/ConverterWorker/ParameterConverterWorker.php deleted file mode 100644 index bf76982a1b..0000000000 --- a/packages/NeonToYamlConverter/src/ConverterWorker/ParameterConverterWorker.php +++ /dev/null @@ -1,55 +0,0 @@ -arrayParameterCollector = $arrayParameterCollector; - } - - /** - * @param mixed[] $parametersData - * @return mixed[] - */ - public function convert(array $parametersData): array - { - foreach ($parametersData as $key => $value) { - if (! is_array($value)) { - continue; - } - - foreach ($value as $key2 => $value2) { - $oldKey = $key . '.' . $key2; - - $newKey = $this->arrayParameterCollector->matchParameterToReplace($oldKey); - if ($newKey === null) { - continue; - } - - // replace key - unset($parametersData[$key][$key2]); - $parametersData[$newKey] = $value2; - } - - if ($parametersData[$key] === []) { - unset($parametersData[$key]); - } - } - - return $parametersData; - } -} diff --git a/packages/NeonToYamlConverter/src/ConverterWorker/ServiceConverterWorker.php b/packages/NeonToYamlConverter/src/ConverterWorker/ServiceConverterWorker.php deleted file mode 100644 index 1cc5853de6..0000000000 --- a/packages/NeonToYamlConverter/src/ConverterWorker/ServiceConverterWorker.php +++ /dev/null @@ -1,210 +0,0 @@ -convertServiceNeonEntities($servicesData); - $servicesData = $this->convertStringNameServices($servicesData); - - foreach ($servicesData as $name => $service) { - if (is_string($service)) { - if (is_string($name) && $service === '~') { - $servicesData[$name] = null; - continue; - } - - $service = $this->convertStringService($service); - } elseif (is_array($service)) { // named service - $service = $this->convertNamedService($service); - } - - $service = $this->convertSetupToCalls($service); - $service = $this->convertArguments($service); - - $servicesData[$name] = $service; - } - - return $servicesData; - } - - /** - * @param mixed|null $service - */ - private function convertStringNameService(array $servicesData, int $name, $service): array - { - if (! is_string($service)) { - return $servicesData; - } - - // just single-class - unset($servicesData[$name]); - - $name = $service; - - $servicesData[$name] = null; - - return $servicesData; - } - - private function convertArguments($service) - { - if (! is_array($service)) { - return $service; - } - - if (! isset($service['arguments'])) { - return $service; - } - - foreach ((array) $service['arguments'] as $key => $value) { - if (! $value instanceof Entity) { - continue; - } - - // environment value! @see https://symfony.com/blog/new-in-symfony-3-4-advanced-environment-variables - if ($value->value === '@env::get') { - $environmentVariable = $value->attributes[0]; - $service['arguments'][$key] = sprintf('%%env(%s)%%', $environmentVariable); - } - } - - return $service; - } - - private function convertSetupToCalls($service) - { - if (! is_array($service)) { - return $service; - } - - if (! isset($service['setup'])) { - return $service; - } - - foreach ((array) $service['setup'] as $key => $value) { - if ($value instanceof Entity) { - $service['setup'][$key] = [$value->value, $value->attributes]; - } - } - - // inline calls - requires fixup in YamlOutputFormatter - $setupYamlContent = Yaml::dump($service['setup'], 1, 4, Yaml::DUMP_OBJECT); - $service['calls'] = $setupYamlContent; - unset($service['setup']); - - return $service; - } - - private function convertNamedService(array $service): array - { - if (! isset($service['class'])) { - return $service; - } - if (! $service['class'] instanceof Entity) { - return $service; - } - - if ($service['class']->attributes !== []) { - $service['arguments'] = $service['class']->attributes; - } - $service['class'] = $service['class']->value; - - return $service; - } - - /** - * @return mixed[] - */ - private function convertServiceEntity(array $servicesData, $name, Entity $entity): array - { - $class = $entity->value; - - $serviceData = [ - 'class' => $class, - 'arguments' => $entity->attributes, - ]; - - if (is_int($name)) { // class-named service - // is namespaced class? - if (Strings::contains($serviceData['class'], '\\')) { - unset($serviceData['class']); - } - - // remove old name - unset($servicesData[$name]); - - $name = $class; - } - - $servicesData[$name] = $serviceData; - - return $servicesData; - } - - /** - * @return mixed[] - */ - private function convertStringService(string $service): array - { - // probably factory, @see https://symfony.com/doc/current/service_container/factories.html - if (Strings::contains($service, '::')) { - return [ - 'factory' => explode('::', $service), - ]; - // probably alias, @see https://symfony.com/doc/current/service_container/alias_private.html#aliasing - } - - if (Strings::startsWith($service, '@')) { - return ['alias' => $service]; - // probably service - } - - return ['class' => $service]; - } - - /** - * @param mixed[] $servicesData - * @return mixed[] - */ - private function convertServiceNeonEntities(array $servicesData): array - { - foreach ($servicesData as $name => $service) { - if (! $service instanceof Entity) { - continue; - } - - $servicesData = $this->convertServiceEntity($servicesData, $name, $service); - } - - return $servicesData; - } - - private function convertStringNameServices(array $servicesData): array - { - foreach ($servicesData as $name => $service) { - if (! is_int($name)) { - continue; - } - - $servicesData = $this->convertStringNameService($servicesData, $name, $service); - } - - return $servicesData; - } -} diff --git a/packages/NeonToYamlConverter/src/Finder/NeonAndYamlFinder.php b/packages/NeonToYamlConverter/src/Finder/NeonAndYamlFinder.php deleted file mode 100644 index ff5769f9d1..0000000000 --- a/packages/NeonToYamlConverter/src/Finder/NeonAndYamlFinder.php +++ /dev/null @@ -1,40 +0,0 @@ -finderSanitizer = $finderSanitizer; - } - - /** - * @return SmartFileInfo[] - */ - public function findYamlAndNeonFilesInfSource(string $source): array - { - if (is_file($source) && file_exists($source)) { - return [new SmartFileInfo($source)]; - } - - $finder = Finder::create() - ->files() - ->in($source) - ->name('#\.(yml|yaml|neon)$#') - ->sortByName(); - - return $this->finderSanitizer->sanitize($finder); - } -} diff --git a/packages/NeonToYamlConverter/src/Formatter/YamlOutputFormatter.php b/packages/NeonToYamlConverter/src/Formatter/YamlOutputFormatter.php deleted file mode 100644 index 8162e1a69b..0000000000 --- a/packages/NeonToYamlConverter/src/Formatter/YamlOutputFormatter.php +++ /dev/null @@ -1,27 +0,0 @@ -load(__DIR__ . '/../../config/config.yaml'); - } - - public function getCacheDir(): string - { - return sys_get_temp_dir() . '/neon_to_yaml_converter'; - } - - public function getLogDir(): string - { - return sys_get_temp_dir() . '/neon_to_yaml_converter_log'; - } - - /** - * @return BundleInterface[] - */ - public function registerBundles(): iterable - { - return []; - } - - protected function build(ContainerBuilder $containerBuilder): void - { - $containerBuilder->addCompilerPass(new AutoReturnFactoryCompilerPass()); - $containerBuilder->addCompilerPass(new AutowireArrayParameterCompilerPass()); - } -} diff --git a/packages/NeonToYamlConverter/src/NeonToYamlConverter.php b/packages/NeonToYamlConverter/src/NeonToYamlConverter.php deleted file mode 100644 index fb5fd777ca..0000000000 --- a/packages/NeonToYamlConverter/src/NeonToYamlConverter.php +++ /dev/null @@ -1,174 +0,0 @@ -arrayParameterCollector = $arrayParameterCollector; - $this->yamlOutputFormatter = $yamlOutputFormatter; - $this->serviceConverterWorker = $serviceConverterWorker; - $this->parameterConverterWorker = $parameterConverterWorker; - } - - public function convertFile(SmartFileInfo $fileInfo): string - { - $content = $fileInfo->getContents(); - - $content = $this->convertEnv($content); - - $data = (array) Neon::decode($content); - - foreach ($data as $key => $value) { - // @traverse deep and subscribe to Entity - if ($value instanceof Entity) { - $data[$key] = $this->convertNeonEntityToArray($value); - } - - if ($key === self::SERVICES_KEY) { - $data[$key] = $this->serviceConverterWorker->convert((array) $value); - } - - if ($key === self::PARAMETERS_KEY) { - $data[$key] = $this->parameterConverterWorker->convert((array) $value); - } - - if ($key === self::INCLUDES_KEY) { - unset($data[$key]); - $importsData = $this->convertIncludes((array) $value); - $importsContent = Yaml::dump($importsData, 1, 4, Yaml::DUMP_OBJECT_AS_MAP); - $data[self::IMPORTS_KEY] = $importsContent; - } - } - - $content = Yaml::dump($data, 100, 4, Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK | Yaml::DUMP_OBJECT); - - $content = $this->replaceAppDirAndWwwDir($content); - $content = $this->replaceTilda($content); - - $content = $this->yamlOutputFormatter->format($content); - - return $this->replaceOldToNewParameters($content); - } - - private function convertEnv(string $content): string - { - // https://regex101.com/r/IxBjFD/1 - return Strings::replace($content, "#\@env::get\(\'?(.*?)\'?(,.*?)?\)#ms", "'%env($1)%'"); - } - - /** - * @return mixed[] - */ - private function convertNeonEntityToArray(Entity $entity): array - { - return array_merge(['value' => $entity->value], $entity->attributes); - } - - /** - * @param mixed[] $data - * @return mixed[] - */ - private function convertIncludes(array $data): array - { - foreach ($data as $key => $value) { - if (! Strings::contains($value, 'vendor')) { - $value = Strings::replace($value, '#\.neon$#', '.yaml'); - } - - $data[$key] = ['resource' => $value]; - } - - return $data; - } - - private function replaceAppDirAndWwwDir(string $content): string - { - // @see https://symfony.com/blog/new-in-symfony-3-3-a-simpler-way-to-get-the-project-root-directory - // %appDir% → %kernel.project_dir%/app - $content = Strings::replace($content, '#%appDir%#', '%kernel.project_dir%/app'); - - // %wwwDir% → %kernel.project_dir%/public - $content = Strings::replace($content, '#%wwwDir%#', '%kernel.project_dir%/public'); - - // %kernel.project_dir%/app/..% → %kernel.project_dir% - return Strings::replace($content, '#%kernel.project_dir%\/app\/\.\.#', '%kernel.project_dir%'); - } - - private function replaceTilda(string $content): string - { - $eolChar = EolConfiguration::getEolChar(); - $content = Strings::replace($content, "#: '~'\n#", ': ~' . $eolChar); - - return Strings::replace($content, "#: null\n#", ': ~' . $eolChar); - } - - private function replaceOldToNewParameters(string $content): string - { - foreach ($this->arrayParameterCollector->getParametersToReplace() as $oldParameter => $newParamter) { - $content = Strings::replace($content, '#' . preg_quote($oldParameter, '#') . '#', $newParamter); - } - - return $content; - } -} diff --git a/packages/NeonToYamlConverter/tests/MultipleFileSource/neon/parameters.neon b/packages/NeonToYamlConverter/tests/MultipleFileSource/neon/parameters.neon deleted file mode 100644 index 4c6d7df8a2..0000000000 --- a/packages/NeonToYamlConverter/tests/MultipleFileSource/neon/parameters.neon +++ /dev/null @@ -1,4 +0,0 @@ -parameters: - payu: - user: pepa - password: abz123 diff --git a/packages/NeonToYamlConverter/tests/MultipleFileSource/neon/services.neon b/packages/NeonToYamlConverter/tests/MultipleFileSource/neon/services.neon deleted file mode 100644 index 70e800cc80..0000000000 --- a/packages/NeonToYamlConverter/tests/MultipleFileSource/neon/services.neon +++ /dev/null @@ -1,5 +0,0 @@ -services: - PayyouSuperService: - arguments: - - '%payu.user%' - - '%payu.password%' diff --git a/packages/NeonToYamlConverter/tests/MultipleFileSource/yaml/parameters.yaml b/packages/NeonToYamlConverter/tests/MultipleFileSource/yaml/parameters.yaml deleted file mode 100644 index f1990d6f80..0000000000 --- a/packages/NeonToYamlConverter/tests/MultipleFileSource/yaml/parameters.yaml +++ /dev/null @@ -1,3 +0,0 @@ -parameters: - payu_user: pepa - payu_password: abz123 diff --git a/packages/NeonToYamlConverter/tests/MultipleFileSource/yaml/services.yaml b/packages/NeonToYamlConverter/tests/MultipleFileSource/yaml/services.yaml deleted file mode 100644 index 2cd0770bc4..0000000000 --- a/packages/NeonToYamlConverter/tests/MultipleFileSource/yaml/services.yaml +++ /dev/null @@ -1,5 +0,0 @@ -services: - PayyouSuperService: - arguments: - - '%payu_user%' - - '%payu_password%' diff --git a/packages/NeonToYamlConverter/tests/MultipleFileTest.php b/packages/NeonToYamlConverter/tests/MultipleFileTest.php deleted file mode 100644 index 1268ffa3d4..0000000000 --- a/packages/NeonToYamlConverter/tests/MultipleFileTest.php +++ /dev/null @@ -1,61 +0,0 @@ -bootKernel(NeonToYamlConverterKernel::class); - $this->neonToYamlConverter = self::$container->get(NeonToYamlConverter::class); - - $arrayParameterCollector = self::$container->get(ArrayParameterCollector::class); - - $this->parametersFileInfo = new SmartFileInfo(__DIR__ . '/MultipleFileSource/neon/parameters.neon'); - $this->servicesFileInfo = new SmartFileInfo(__DIR__ . '/MultipleFileSource/neon/services.neon'); - - $fileInfos = [$this->parametersFileInfo, $this->servicesFileInfo]; - $arrayParameterCollector->collectFromFiles($fileInfos); - } - - public function test(): void - { - $convertedContent = $this->neonToYamlConverter->convertFile($this->parametersFileInfo); - $this->assertStringEqualsFile(__DIR__ . '/MultipleFileSource/yaml/parameters.yaml', $convertedContent); - - $convertedContent = $this->neonToYamlConverter->convertFile($this->servicesFileInfo); - $this->assertStringEqualsFile(__DIR__ . '/MultipleFileSource/yaml/services.yaml', $convertedContent); - } - - public function testInversed(): void - { - $convertedContent = $this->neonToYamlConverter->convertFile($this->servicesFileInfo); - $this->assertStringEqualsFile(__DIR__ . '/MultipleFileSource/yaml/services.yaml', $convertedContent); - - $convertedContent = $this->neonToYamlConverter->convertFile($this->parametersFileInfo); - $this->assertStringEqualsFile(__DIR__ . '/MultipleFileSource/yaml/parameters.yaml', $convertedContent); - } -} diff --git a/packages/NeonToYamlConverter/tests/NeonToYamlConverterTest.php b/packages/NeonToYamlConverter/tests/NeonToYamlConverterTest.php deleted file mode 100644 index b5db4f9366..0000000000 --- a/packages/NeonToYamlConverter/tests/NeonToYamlConverterTest.php +++ /dev/null @@ -1,92 +0,0 @@ -bootKernel(NeonToYamlConverterKernel::class); - - $this->neonToYamlConverter = self::$container->get(NeonToYamlConverter::class); - $this->arrayParameterCollector = self::$container->get(ArrayParameterCollector::class); - } - - /** - * @dataProvider provideData() - * @dataProvider provideDataWithParameters() - * @dataProvider provideDataWithServices() - */ - public function test(string $inputFile, string $expectedFile): void - { - $inputFileInfo = new SmartFileInfo($inputFile); - - $this->arrayParameterCollector->collectFromFiles([$inputFileInfo]); - - $convertedFile = $this->neonToYamlConverter->convertFile($inputFileInfo); - $this->assertStringEqualsFile($expectedFile, $convertedFile, 'Caused in file: ' . $inputFile); - } - - public function provideData(): Iterator - { - yield [__DIR__ . '/Source/neon/lists.neon', __DIR__ . '/Source/yaml/lists.yaml']; - yield [__DIR__ . '/Source/neon/multi_line_content.neon', __DIR__ . '/Source/yaml/multi_line_content.yaml']; - yield [__DIR__ . '/Source/neon/entity.neon', __DIR__ . '/Source/yaml/entity.yaml']; - yield [__DIR__ . '/Source/neon/imports.neon', __DIR__ . '/Source/yaml/imports.yaml']; - yield [__DIR__ . '/Source/neon/env.neon', __DIR__ . '/Source/yaml/env.yaml']; - yield [__DIR__ . '/Source/neon/tilda.neon', __DIR__ . '/Source/yaml/tilda.yaml']; - } - - public function provideDataWithParameters(): Iterator - { - yield [ - __DIR__ . '/Source/neon/parameters/app_dir_parameter.neon', - __DIR__ . '/Source/yaml/parameters/app_dir_parameter.yaml', - ]; - - yield [ - __DIR__ . '/Source/neon/parameters/skip_parameter_inline.neon', - __DIR__ . '/Source/yaml/parameters/skip_parameter_inline.yaml', - ]; - - yield [ - __DIR__ . '/Source/neon/parameters/nested_parameter.neon', - __DIR__ . '/Source/yaml/parameters/nested_parameter.yaml', - ]; - } - - public function provideDataWithServices(): Iterator - { - yield [__DIR__ . '/Source/neon/services/basic.neon', __DIR__ . '/Source/yaml/services/basic.yaml']; - yield [__DIR__ . '/Source/neon/services/null.neon', __DIR__ . '/Source/yaml/services/null.yaml']; - yield [__DIR__ . '/Source/neon/services/list.neon', __DIR__ . '/Source/yaml/services/list.yaml']; - yield [__DIR__ . '/Source/neon/services/alias.neon', __DIR__ . '/Source/yaml/services/alias.yaml']; - yield [__DIR__ . '/Source/neon/services/entity.neon', __DIR__ . '/Source/yaml/services/entity.yaml']; - yield [__DIR__ . '/Source/neon/services/setup.neon', __DIR__ . '/Source/yaml/services/setup.yaml']; - - yield [ - __DIR__ . '/Source/neon/services/without_namespace.neon', - __DIR__ . '/Source/yaml/services/without_namespace.yaml', - ]; - yield [__DIR__ . '/Source/neon/services/arguments.neon', __DIR__ . '/Source/yaml/services/arguments.yaml']; - } -} diff --git a/packages/NeonToYamlConverter/tests/Source/neon/entity.neon b/packages/NeonToYamlConverter/tests/Source/neon/entity.neon deleted file mode 100644 index 87c85018d2..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/neon/entity.neon +++ /dev/null @@ -1 +0,0 @@ -someValue: Column(type=int, nulls=true) diff --git a/packages/NeonToYamlConverter/tests/Source/neon/env.neon b/packages/NeonToYamlConverter/tests/Source/neon/env.neon deleted file mode 100644 index 9cab60b131..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/neon/env.neon +++ /dev/null @@ -1,3 +0,0 @@ -doctrine: - dbal: - host: @env::get('MYSQL_HOST') diff --git a/packages/NeonToYamlConverter/tests/Source/neon/imports.neon b/packages/NeonToYamlConverter/tests/Source/neon/imports.neon deleted file mode 100644 index 90f0a61508..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/neon/imports.neon +++ /dev/null @@ -1,3 +0,0 @@ -includes: - - packages/EasyCodingStandard/config/psr2.neon - - vendor/EasyCodingStandard/config/clean-code.neon diff --git a/packages/NeonToYamlConverter/tests/Source/neon/lists.neon b/packages/NeonToYamlConverter/tests/Source/neon/lists.neon deleted file mode 100644 index 59ac06bc57..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/neon/lists.neon +++ /dev/null @@ -1,7 +0,0 @@ -items: - - 1 - b: 2 - -ouje: - - SomeService - SomeService: \ No newline at end of file diff --git a/packages/NeonToYamlConverter/tests/Source/neon/multi_line_content.neon b/packages/NeonToYamlConverter/tests/Source/neon/multi_line_content.neon deleted file mode 100644 index 31f5f4bf27..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/neon/multi_line_content.neon +++ /dev/null @@ -1,4 +0,0 @@ -perex: ''' - This is long multiline perex, - that takes too much space. -''' \ No newline at end of file diff --git a/packages/NeonToYamlConverter/tests/Source/neon/parameters/app_dir_parameter.neon b/packages/NeonToYamlConverter/tests/Source/neon/parameters/app_dir_parameter.neon deleted file mode 100644 index 99e5fc3887..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/neon/parameters/app_dir_parameter.neon +++ /dev/null @@ -1,8 +0,0 @@ -parameters: - file_storage: '%appDir%/file_storage' - public_storage: '%wwwDir%/some/upload' - -services: - Entrydo\App\Console\DB\LoadDemoDataCommand: - arguments: - - '%appDir%/../fixtures' diff --git a/packages/NeonToYamlConverter/tests/Source/neon/parameters/nested_parameter.neon b/packages/NeonToYamlConverter/tests/Source/neon/parameters/nested_parameter.neon deleted file mode 100644 index 1ff1f7504c..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/neon/parameters/nested_parameter.neon +++ /dev/null @@ -1,12 +0,0 @@ -parameters: - payu: - user: pepa - password: abz123 - GPWebPay: - webpayUrl: 'https://test.3dsecure.gpwebpay.com/pgw/order.do' - -services: - PayyouSuperService: - arguments: - - '%payu.user%' - - '%payu.password%' diff --git a/packages/NeonToYamlConverter/tests/Source/neon/parameters/skip_parameter_inline.neon b/packages/NeonToYamlConverter/tests/Source/neon/parameters/skip_parameter_inline.neon deleted file mode 100644 index 8f20e00387..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/neon/parameters/skip_parameter_inline.neon +++ /dev/null @@ -1,9 +0,0 @@ -parameters: - langs: - cs: Czech - en: English - -services: - sth: - arguments: - - '%langs%' diff --git a/packages/NeonToYamlConverter/tests/Source/neon/services/alias.neon b/packages/NeonToYamlConverter/tests/Source/neon/services/alias.neon deleted file mode 100644 index 089ae44f28..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/neon/services/alias.neon +++ /dev/null @@ -1,3 +0,0 @@ -services: - identityStorage: @Entrydo\Infrastructure\Security\FallbackIdentityStorage - namedService: Entrydo\Infrastructure\Security\FallbackIdentityStorage diff --git a/packages/NeonToYamlConverter/tests/Source/neon/services/arguments.neon b/packages/NeonToYamlConverter/tests/Source/neon/services/arguments.neon deleted file mode 100644 index a574a72d9b..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/neon/services/arguments.neon +++ /dev/null @@ -1,2 +0,0 @@ -services: - braintreeGateway: Braintree\Gateway([environment: %braintree.environment%, merchantId: %braintree.merchantId%, publicKey: %braintree.publicKey%, privateKey: %braintree.privateKey%]) diff --git a/packages/NeonToYamlConverter/tests/Source/neon/services/basic.neon b/packages/NeonToYamlConverter/tests/Source/neon/services/basic.neon deleted file mode 100644 index 9140d8857b..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/neon/services/basic.neon +++ /dev/null @@ -1,7 +0,0 @@ -services: - application.presenterFactory: @Entrydo\App\Presenters\ClassPresenterNameAwarePresenterFactory - doctrineEvents.symfonyProxy: - autowired: false - router: @Entrydo\App\Routing\RouterFactory::create - mailer: Entrydo\Infrastructure\Mailing\MailGunMailer(%mailgun.apiKey%, %mailgun.domain%, @emailValidator) - eventMailer: Entrydo\Infrastructure\Mailing\MailGunMailer(%mailgun.apiKey%, %mailgun.ticketsDomain%) diff --git a/packages/NeonToYamlConverter/tests/Source/neon/services/entity.neon b/packages/NeonToYamlConverter/tests/Source/neon/services/entity.neon deleted file mode 100644 index 58bda40715..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/neon/services/entity.neon +++ /dev/null @@ -1,2 +0,0 @@ -services: - - Entrydo\Application\CompanyPublicInfo\CompanyPublicInfoUseCase(@ares) diff --git a/packages/NeonToYamlConverter/tests/Source/neon/services/list.neon b/packages/NeonToYamlConverter/tests/Source/neon/services/list.neon deleted file mode 100644 index 4555874372..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/neon/services/list.neon +++ /dev/null @@ -1,16 +0,0 @@ -services: - - Entrydo\Infrastructure\Mailing\SendGridMailer - - Entrydo\App\Routing\RouterFactory - - Entrydo\App\HttpRequest\RequestBodyHelper - - Entrydo\Infrastructure\Persistence\Doctrine\DoctrineUserRepository - - Entrydo\Infrastructure\Persistence\Doctrine\DoctrineCustomerRepository - - Entrydo\Infrastructure\Persistence\Doctrine\DoctrineTicketRepository - - Entrydo\Infrastructure\Persistence\Doctrine\DoctrineEventRepository - - Entrydo\Infrastructure\Persistence\Doctrine\DoctrineOrderRepository - - Entrydo\Infrastructure\Persistence\Doctrine\DoctrineTicketVariantRepository - - Entrydo\Infrastructure\Persistence\Doctrine\DoctrineTrackingCodeRepository - - Entrydo\Application\UserInfo\UserInfoUseCase - - Entrydo\Application\EditUserInfo\EditUserInfoUseCase - - Entrydo\Domain\Specifications\Email\EmailIsUnique - - Entrydo\Application\ListCountries\ListCountriesUseCase(%country.enabled%) - - Entrydo\Application\ListCurrencies\ListCurrenciesUseCase(%currency.enabled%) diff --git a/packages/NeonToYamlConverter/tests/Source/neon/services/null.neon b/packages/NeonToYamlConverter/tests/Source/neon/services/null.neon deleted file mode 100644 index 0b297e5d6e..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/neon/services/null.neon +++ /dev/null @@ -1,2 +0,0 @@ -services: - Oups\SomeService: ~ diff --git a/packages/NeonToYamlConverter/tests/Source/neon/services/setup.neon b/packages/NeonToYamlConverter/tests/Source/neon/services/setup.neon deleted file mode 100644 index c53c3728dd..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/neon/services/setup.neon +++ /dev/null @@ -1,7 +0,0 @@ -services: - monologStreamHandler: - class: Monolog\Handler\StreamHandler('php://stderr') - tags: [monolog.handler] - setup: - - setFormatter(@Entrydo\Infrastructure\Logging\Monolog\LogDNAJsonFormatter) - - setThat(1, 2) diff --git a/packages/NeonToYamlConverter/tests/Source/neon/services/without_namespace.neon b/packages/NeonToYamlConverter/tests/Source/neon/services/without_namespace.neon deleted file mode 100644 index e617bf735d..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/neon/services/without_namespace.neon +++ /dev/null @@ -1,2 +0,0 @@ -services: - - SendGrid(@env::get('SENDGRID_API_KEY', '')) diff --git a/packages/NeonToYamlConverter/tests/Source/neon/tilda.neon b/packages/NeonToYamlConverter/tests/Source/neon/tilda.neon deleted file mode 100644 index de32cbfa26..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/neon/tilda.neon +++ /dev/null @@ -1,3 +0,0 @@ -framework: - router: - strict_requirements: ~ # should be null diff --git a/packages/NeonToYamlConverter/tests/Source/yaml/entity.yaml b/packages/NeonToYamlConverter/tests/Source/yaml/entity.yaml deleted file mode 100644 index 53c53b562c..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/yaml/entity.yaml +++ /dev/null @@ -1,4 +0,0 @@ -someValue: - value: Column - type: int - nulls: true diff --git a/packages/NeonToYamlConverter/tests/Source/yaml/env.yaml b/packages/NeonToYamlConverter/tests/Source/yaml/env.yaml deleted file mode 100644 index ec6788b39b..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/yaml/env.yaml +++ /dev/null @@ -1,3 +0,0 @@ -doctrine: - dbal: - host: '%env(MYSQL_HOST)%' diff --git a/packages/NeonToYamlConverter/tests/Source/yaml/imports.yaml b/packages/NeonToYamlConverter/tests/Source/yaml/imports.yaml deleted file mode 100644 index e84c439551..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/yaml/imports.yaml +++ /dev/null @@ -1,3 +0,0 @@ -imports: - - { resource: packages/EasyCodingStandard/config/psr2.yaml } - - { resource: vendor/EasyCodingStandard/config/clean-code.neon } diff --git a/packages/NeonToYamlConverter/tests/Source/yaml/lists.yaml b/packages/NeonToYamlConverter/tests/Source/yaml/lists.yaml deleted file mode 100644 index 47475bb433..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/yaml/lists.yaml +++ /dev/null @@ -1,7 +0,0 @@ -items: - 0: 1 - b: 2 - -ouje: - 0: SomeService - SomeService: ~ diff --git a/packages/NeonToYamlConverter/tests/Source/yaml/multi_line_content.yaml b/packages/NeonToYamlConverter/tests/Source/yaml/multi_line_content.yaml deleted file mode 100644 index 6d34974833..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/yaml/multi_line_content.yaml +++ /dev/null @@ -1,3 +0,0 @@ -perex: | - This is long multiline perex, - that takes too much space. diff --git a/packages/NeonToYamlConverter/tests/Source/yaml/parameters/app_dir_parameter.yaml b/packages/NeonToYamlConverter/tests/Source/yaml/parameters/app_dir_parameter.yaml deleted file mode 100644 index 79fd8f1d42..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/yaml/parameters/app_dir_parameter.yaml +++ /dev/null @@ -1,8 +0,0 @@ -parameters: - file_storage: '%kernel.project_dir%/app/file_storage' - public_storage: '%kernel.project_dir%/public/some/upload' - -services: - Entrydo\App\Console\DB\LoadDemoDataCommand: - arguments: - - '%kernel.project_dir%/fixtures' diff --git a/packages/NeonToYamlConverter/tests/Source/yaml/parameters/nested_parameter.yaml b/packages/NeonToYamlConverter/tests/Source/yaml/parameters/nested_parameter.yaml deleted file mode 100644 index d38a0d344a..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/yaml/parameters/nested_parameter.yaml +++ /dev/null @@ -1,11 +0,0 @@ -parameters: - GPWebPay: - webpayUrl: 'https://test.3dsecure.gpwebpay.com/pgw/order.do' - payu_user: pepa - payu_password: abz123 - -services: - PayyouSuperService: - arguments: - - '%payu_user%' - - '%payu_password%' diff --git a/packages/NeonToYamlConverter/tests/Source/yaml/parameters/skip_parameter_inline.yaml b/packages/NeonToYamlConverter/tests/Source/yaml/parameters/skip_parameter_inline.yaml deleted file mode 100644 index 8f20e00387..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/yaml/parameters/skip_parameter_inline.yaml +++ /dev/null @@ -1,9 +0,0 @@ -parameters: - langs: - cs: Czech - en: English - -services: - sth: - arguments: - - '%langs%' diff --git a/packages/NeonToYamlConverter/tests/Source/yaml/services/alias.yaml b/packages/NeonToYamlConverter/tests/Source/yaml/services/alias.yaml deleted file mode 100644 index f4d0e746bc..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/yaml/services/alias.yaml +++ /dev/null @@ -1,5 +0,0 @@ -services: - identityStorage: - alias: '@Entrydo\Infrastructure\Security\FallbackIdentityStorage' - namedService: - class: Entrydo\Infrastructure\Security\FallbackIdentityStorage diff --git a/packages/NeonToYamlConverter/tests/Source/yaml/services/arguments.yaml b/packages/NeonToYamlConverter/tests/Source/yaml/services/arguments.yaml deleted file mode 100644 index e4e8d7c895..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/yaml/services/arguments.yaml +++ /dev/null @@ -1,9 +0,0 @@ -services: - braintreeGateway: - class: Braintree\Gateway - arguments: - - - environment: '%braintree_environment%' - merchantId: '%braintree_merchant_id%' - publicKey: '%braintree_public_key%' - privateKey: '%braintree_private_key%' diff --git a/packages/NeonToYamlConverter/tests/Source/yaml/services/basic.yaml b/packages/NeonToYamlConverter/tests/Source/yaml/services/basic.yaml deleted file mode 100644 index 90d18b731e..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/yaml/services/basic.yaml +++ /dev/null @@ -1,18 +0,0 @@ -services: - application.presenterFactory: - alias: '@Entrydo\App\Presenters\ClassPresenterNameAwarePresenterFactory' - doctrineEvents.symfonyProxy: - autowired: false - router: - factory: ['@Entrydo\App\Routing\RouterFactory', create] - mailer: - class: Entrydo\Infrastructure\Mailing\MailGunMailer - arguments: - - '%mailgun_api_key%' - - '%mailgun_domain%' - - '@emailValidator' - eventMailer: - class: Entrydo\Infrastructure\Mailing\MailGunMailer - arguments: - - '%mailgun_api_key%' - - '%mailgun_tickets_domain%' diff --git a/packages/NeonToYamlConverter/tests/Source/yaml/services/entity.yaml b/packages/NeonToYamlConverter/tests/Source/yaml/services/entity.yaml deleted file mode 100644 index 0047a5f9fc..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/yaml/services/entity.yaml +++ /dev/null @@ -1,4 +0,0 @@ -services: - Entrydo\Application\CompanyPublicInfo\CompanyPublicInfoUseCase: - arguments: - - '@ares' diff --git a/packages/NeonToYamlConverter/tests/Source/yaml/services/list.yaml b/packages/NeonToYamlConverter/tests/Source/yaml/services/list.yaml deleted file mode 100644 index 9caa292c4c..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/yaml/services/list.yaml +++ /dev/null @@ -1,20 +0,0 @@ -services: - Entrydo\Application\ListCountries\ListCountriesUseCase: - arguments: - - '%country_enabled%' - Entrydo\Application\ListCurrencies\ListCurrenciesUseCase: - arguments: - - '%currency_enabled%' - Entrydo\Infrastructure\Mailing\SendGridMailer: ~ - Entrydo\App\Routing\RouterFactory: ~ - Entrydo\App\HttpRequest\RequestBodyHelper: ~ - Entrydo\Infrastructure\Persistence\Doctrine\DoctrineUserRepository: ~ - Entrydo\Infrastructure\Persistence\Doctrine\DoctrineCustomerRepository: ~ - Entrydo\Infrastructure\Persistence\Doctrine\DoctrineTicketRepository: ~ - Entrydo\Infrastructure\Persistence\Doctrine\DoctrineEventRepository: ~ - Entrydo\Infrastructure\Persistence\Doctrine\DoctrineOrderRepository: ~ - Entrydo\Infrastructure\Persistence\Doctrine\DoctrineTicketVariantRepository: ~ - Entrydo\Infrastructure\Persistence\Doctrine\DoctrineTrackingCodeRepository: ~ - Entrydo\Application\UserInfo\UserInfoUseCase: ~ - Entrydo\Application\EditUserInfo\EditUserInfoUseCase: ~ - Entrydo\Domain\Specifications\Email\EmailIsUnique: ~ diff --git a/packages/NeonToYamlConverter/tests/Source/yaml/services/null.yaml b/packages/NeonToYamlConverter/tests/Source/yaml/services/null.yaml deleted file mode 100644 index 0b297e5d6e..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/yaml/services/null.yaml +++ /dev/null @@ -1,2 +0,0 @@ -services: - Oups\SomeService: ~ diff --git a/packages/NeonToYamlConverter/tests/Source/yaml/services/setup.yaml b/packages/NeonToYamlConverter/tests/Source/yaml/services/setup.yaml deleted file mode 100644 index e5d7c0f213..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/yaml/services/setup.yaml +++ /dev/null @@ -1,10 +0,0 @@ -services: - monologStreamHandler: - class: Monolog\Handler\StreamHandler - tags: - - monolog.handler - arguments: - - 'php://stderr' - calls: - - [setFormatter, ['@Entrydo\Infrastructure\Logging\Monolog\LogDNAJsonFormatter']] - - [setThat, [1, 2]] diff --git a/packages/NeonToYamlConverter/tests/Source/yaml/services/without_namespace.yaml b/packages/NeonToYamlConverter/tests/Source/yaml/services/without_namespace.yaml deleted file mode 100644 index 76c095b359..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/yaml/services/without_namespace.yaml +++ /dev/null @@ -1,5 +0,0 @@ -services: - SendGrid: - class: SendGrid - arguments: - - '%env(SENDGRID_API_KEY)%' diff --git a/packages/NeonToYamlConverter/tests/Source/yaml/tilda.yaml b/packages/NeonToYamlConverter/tests/Source/yaml/tilda.yaml deleted file mode 100644 index 368bc7f491..0000000000 --- a/packages/NeonToYamlConverter/tests/Source/yaml/tilda.yaml +++ /dev/null @@ -1,3 +0,0 @@ -framework: - router: - strict_requirements: ~