laravel-langman icon indicating copy to clipboard operation
laravel-langman copied to clipboard

Lang files are not PSR-2

Open tayyabhussain opened this issue 7 years ago • 3 comments

  • Laravel Version: 5.1
  • PHP Version: 5.6
  • Database Driver & Version:

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 avatar May 15 '17 06:05 tayyabhussain

@themsaid please see this

tayyabhussain avatar Jun 01 '17 07:06 tayyabhussain

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

themsaid avatar Jun 02 '17 10:06 themsaid

@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);
    }

tayyabhussain avatar Aug 07 '17 06:08 tayyabhussain