Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed symfony/yaml dependency #136

Merged
merged 1 commit into from
Jan 25, 2025

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