themsaid / laravel-langman

Language files manager in your artisan console.
MIT License
876 stars 166 forks source link

Lang files are not PSR-2 #67

Open tayyabhussain opened 7 years ago

tayyabhussain commented 7 years ago

Description:

Whenever I add translations in lang files via langman, Langman does not write into files according to PSR-2 standards. 1- It adds one space after "<?php " 2- It does not add line break at the end of array

Steps to reproduce:

1- add any translation via langman

tayyabhussain commented 7 years ago

@themsaid please see this

themsaid commented 7 years ago

Not sure if we should care about that :) Feel free to open a PR though if you feel such fix is so important.

tayyabhussain commented 7 years ago

@themsaid I'm afraid, I don't have access to generate a PR, You just need to replace writeFile function with below code

public function writeFile($filePath, array $translations)
    {
        $content = "<?php\n\nreturn [";

        $content .= $this->stringLineMaker($translations);

        $content .= "\n];\n";

        file_put_contents($filePath, $content);
    }