A wrapper around symplify/config-transformer used to update recipes and using easy coding standard for generating readable config files.

Overview

Symfony Recipes Yaml to PHP Converter

This is a wrapper around the symplify/config-transformer used to convert Symfony core recipes which uses .yaml config files to .php config files.

It is used in:

To convert the official symfony recipes.

vendor/bin/yaml-to-php [email protected]:symfony/recipes.git
vendor/bin/yaml-to-php [email protected]:symfony/recipes-contrib.git

If you are not converting a recipes repository you should use the symplify/config-transformer directly instead of using this package.

Skeletons

There are currently also 2 skeletons shipped which can be used to create new symfony projects:

symfony/skeleton clone:

schranz/symfony-php-skeleton:

composer create-project schranz/symfony-php-skeleton

symfony/website-skeleton clone:

schranz/symfony-php-website-skeleton:

composer create-project schranz/symfony-php-website-skeleton

Using in exist projects

First convert your project with symplify/config-transformer from .yaml to .php configs after add the following to the composer extra.symfony.endpoint configuration:

    "extra": {
        "symfony": {
            "allow-contrib": false,
            "require": "6.1.*",
            "endpoint": [
                "https://raw.githubusercontent.com/alexander-schranz/symfony-recipes-php/flex/main/index.json",
                "https://raw.githubusercontent.com/alexander-schranz/symfony-recipes-php-contrib/flex/main/index.json",
                "flex://defaults"
            ]
        }
    }
Comments
  • Create a automatic update process

    Create a automatic update process

    The repositories need some script which update the current php recipes and regenerate all package from stretch:

    Something like

    vendor/bin/yaml-to-php [email protected]:symfony/recipes.git
    
    # later in the github CI it should push it
    git add .
    git commit 
    git push
    

    TODO

    • [x] Move clone and update of yaml to php file into a converter (is now this repository)
    • [x] Create Github action to call the script
    • [x] Push changes to main branch of repositories
    help wanted recipes-repositories 
    opened by alexander-schranz 2
  • Fix existing CIs for pull request

    Fix existing CIs for pull request

    Currently the CI for pull requests does not work:

    • https://github.com/alexander-schranz/symfony-recipes-php/pull/2
    • https://github.com/alexander-schranz/symfony-recipes-php-contrib/pull/2/commits

    It seems some secrets are missing, but not sure what need to be configured here.

    help wanted 
    opened by alexander-schranz 1
  • Convert PHP Array Config to PHP ConfigBuilder

    Convert PHP Array Config to PHP ConfigBuilder

    Since Symfony 5.3 there exist a new way of configuring packages. The config builders:

    https://symfony.com/blog/new-in-symfony-5-3-config-builder-classes

    It would be great as we are currently having done the step from yaml to php configs. To do the next step from PHP array configs to PHP config builder configs.

    Not sure how easy possible without knowing the Builder class and only the array this is even possible.

    feature 
    opened by alexander-schranz 5
  • Convert Comment examples

    Convert Comment examples

    Currently when converting yaml to php there are 2 types of comments:

    # text comments
    
    #example:
    #   comments: []
    

    It would be great depending on # some vs #some convert also commented out yaml configuration into commented out php configuration.

    This is blocked by #1 before it can even be targetted we need first support comments in general.

    blocked 
    opened by alexander-schranz 0
  • Keep / Convert Yaml comments to PHP

    Keep / Convert Yaml comments to PHP

    Currently the config-transformer is using the symfony/yaml package. Instead we should use a package which is supporting to read comments from yaml files as they provide many usefull things like links to documentation.

    Yaml:

    # Read the documentation at https://github.com/thephpleague/flysystem-bundle/blob/master/docs/1-getting-started.md
    flysystem:
        storages:
            default.storage:
                adapter: 'local'
                options:
                    directory: '%kernel.project_dir%/%VAR_DIR%/storage/default'
    

    Expected PHP Result:

    <?php
    
    declare(strict_types=1);
    
    use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
    
    return static function (ContainerConfigurator $containerConfigurator): void {
        // Read the documentation at https://github.com/thephpleague/flysystem-bundle/blob/master/docs/1-getting-started.md
        $containerConfigurator->extension('flysystem', [
            'storages' => [
                'default.storage' => [
                    'adapter' => 'local',
                    'options' => [
                        'directory' => '%kernel.project_dir%/%VAR_DIR%/storage/default',
                    ],
                ],
            ],
        ]);  
    };
    

    Currently the comment is missing which adds a lot of value.

    Related issues:

    • https://github.com/symplify/symplify/issues/4274
    • https://github.com/symfony/symfony/issues/22516
    bug help wanted 
    opened by alexander-schranz 1
Owner
Alexander Schranz
Core Developer @sulu likes @php, @symfony, @elasticsearch, @redis, react js
Alexander Schranz
WPForms coding standards are based on the WordPress Coding Standards and the PHPCompatibility Coding Standards and help create strict and high-quality code.

WPForms coding standards are based on the WordPress Coding Standards and the PHPCompatibility Coding Standards and help create strict and high-quality code.

Awesome Motive, Inc. 7 Nov 29, 2022
Set of rules for PHP_CodeSniffer and PHP-CS-Fixer used by Symplify projects.

20+ Coding Standard checkers for PHP projects with focus on Clean Architecture

null 281 Dec 30, 2022
Easy Coding Standard configurations for Craft CMS projects.

Easy Coding Standard config for Craft CMs This package provides Easy Coding Standard configurations for Craft CMS plugins and projects. In general, we

Craft CMS 10 Dec 18, 2022
This package provides a set of factories to be used with containers using the PSR-11 standard for an easy Doctrine integration in a project

psr-container-doctrine: Doctrine Factories for PSR-11 Containers Doctrine factories for PSR-11 containers. This package provides a set of factories to

Roave, LLC 84 Dec 14, 2022
Documentation on clean coding and demonstration of studied clean coding principals with PHP.

practice-php-clean-code Documentation on clean coding and demonstration of studied clean coding principals with PHP. The document contained in this re

Ferdous Islam 1 Feb 21, 2022
SlimJim was born out of a need for a simple auto update script which would update multiple development/test environments every time someone

SlimJim WHY? SlimJim was born out of a need for a simple auto update script which would update multiple development/test environments every time someo

Jesal Gadhia 100 Apr 22, 2022
Magento 1.x Coding Standard

Magento Extension Quality Program Coding Standard ⚠️ Versions 3.0.0 and above of the MEQP Coding Standard are for Magento 1.x code only. To check Mage

Magento 224 Nov 29, 2022
Magento Coding Standard

Magento Coding Standard A set of Magento rules for PHP_CodeSniffer tool. Installation within a Magento 2 site To use within your Magento 2 project you

Magento 290 Dec 31, 2022
Provide CSV, JSON, XML and YAML files as an Import Source for the Icinga Director and optionally ship hand-crafted additional Icinga2 config files

Icinga Web 2 Fileshipper module The main purpose of this module is to extend Icinga Director using some of it's exported hooks. Based on them it offer

Icinga 25 Sep 18, 2022
WordPlate is a wrapper around WordPress. It makes developers life easier. It is just like building any other WordPress website with themes and plugins. Just with sprinkles on top.

WordPlate is simply a wrapper around WordPress. It makes developers life easier. It is just like building any other WordPress website with themes and plugins. Just with sprinkles on top.

WordPlate 1.7k Dec 24, 2022
Optimizes class loading performance by generating a single PHP file containing all of the autoloaded files.

Class Preloader for PHP This tool is used to generate a single PHP script containing all of the classes required for a specific use case. Using a sing

Class Preloader 356 Nov 26, 2022
Cookbook-magento - Collection of recipes to build app stack for the Magento deployments with Chef

Magento Cookbook Collection of recipes to build app stack for the Magento deployments with Chef Installation With Berkshelf echo "cookbook 'magento',

Yevhen Viktorov 37 Sep 26, 2020
Helper plugin to install SilverStripe recipes

SilverStripe recipe-plugin Introduction This plugin enhances composer and allows for the installation of "silverstripe-recipe" packages. These recipes

Silverstripe CMS 10 Oct 4, 2022
Repository containing all the PHPStan rules from the book "Recipes for Decoupling"

PHPStan rules from the book "Recipes for Decoupling" by Matthias Noback In the book "Recipes for Decoupling" we discuss how to decouple from web and C

Matthias Noback 19 Sep 21, 2022
This is a simple Wrapper around the ZipArchive methods with some handy functions

Note I haven't updated this package in a long time except merging PRs. The last time I was using this package was with PHP5. I archived the repository

Nils Plaschke 845 Dec 13, 2022
This is a simple Wrapper around the ZipArchive methods with some handy functions

Note I haven't updated this package in a long time except merging PRs. The last time I was using this package was with PHP5. I archived the repository

Nils Plaschke 836 Jan 26, 2022
A wrapper around faker for factory muffin

Factory Muffin Faker 2.3 The goal of this package is to wrap Faker to make it super easy to use with Factory Muffin. Note that this library does not a

The League of Extraordinary Packages 36 Nov 29, 2022
An object oriented wrapper around PHP's built-in server.

Statix Server Requirements PHP 8 minumum Installation composer require statix/server Basic Usage To get started, ensure the vendor autoload script is

Statix PHP 113 Dec 27, 2022
A PHP wrapper around Libreoffice for converting documents from one format to another.

Document Converter A PHP wrapper around Libreoffice for converting documents from one format to another. For example: Microsoft Word to PDF OpenOffice

Lukas White 0 Jul 28, 2022