Skip to content

Removed symfony/yaml dependency#136

Merged
norberttech merged 1 commit into
coduo:5.xfrom
norberttech:remove-yaml-dependency
Jan 25, 2025
Merged

Removed symfony/yaml dependency#136
norberttech merged 1 commit into
coduo:5.xfrom
norberttech:remove-yaml-dependency

Conversation

@norberttech

@norberttech norberttech commented Jan 25, 2025

Copy link
Copy Markdown
Member

Change Log

Added

Fixed

Changed

Removed

  • symfony/yaml dependency

Deprecated

Security


Description

Resolves: #135

Converted with:

<?php

use Symfony\Component\Yaml\Yaml;

require __DIR__ . '/vendor/autoload.php';

$translationsFolder = __DIR__ . '/src/Coduo/PHPHumanizer/Resources/translations';

$yamlFiles = glob($translationsFolder . '/*.yml');

foreach ($yamlFiles as $file) {

    // Read and parse the YAML file
    $yamlContent = file_get_contents($file);
    $parsedData  = Yaml::parse($yamlContent);

    $exported = var_export($parsedData, true);

    $phpOutput = <<<PHP
<?php

return $exported;

PHP;

    $file = preg_replace('/\.yml$/', '.php', $file);
    file_put_contents($file, $phpOutput);
}

@norberttech norberttech merged commit f70d3a9 into coduo:5.x Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace translations in Yaml with pure PHP

1 participant