Skip to content

Conversation

@norberttech
Copy link
Member

@norberttech norberttech commented Jan 25, 2025

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
13 checks passed
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