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

Lang files are not PSR-2 #67

Open
tayyabhussain opened this issue May 15, 2017 · 3 comments · May be fixed by #71
Open

Lang files are not PSR-2 #67

tayyabhussain opened this issue May 15, 2017 · 3 comments · May be fixed by #71

Comments

@tayyabhussain
Copy link

  • 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
Copy link
Author

@themsaid please see this

@themsaid
Copy link
Owner

themsaid commented Jun 2, 2017

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

@tayyabhussain
Copy link
Author

tayyabhussain commented Aug 7, 2017

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

@nicolasbeauvais nicolasbeauvais linked a pull request Oct 9, 2017 that will close this issue
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 a pull request may close this issue.

2 participants