potsky / laravel-localization-helpers

🎌 Artisan commands to generate and update lang files automatically
GNU General Public License v3.0
187 stars 38 forks source link

[Question] Generated files coding style #15

Closed alariva closed 8 years ago

alariva commented 8 years ago

Is there a way to configure coding style?

I mean for having -say- PSR-2 compliant output.

  1. Array declaration syntax array() vs []
  2. Indentation depth

I know there might not be a way to change this by parameter, but I cannot either figure out where to change that in the code. I may raise a PR otherwise :)

potsky commented 8 years ago

Hi !

Good idea, I will use PHPCSFixer and add new options to let you configure the output format as you want !

alariva commented 8 years ago

Sounds great! This allows to avoid extra formatting work after running translation functions, and keeps code PSR-2 compliant. :+1:

potsky commented 8 years ago

Hi !

The new version with your feature is ready. I have totally rewritten the package and added new features like automatic translations with Bing Translator, code style for lang files, etc... Do you want to test it before going on production?

alariva commented 8 years ago

Hey, thanks for comments and sorry for the late reply. I'd like to test it. Silly question but still, have you got instructions for testing it? I could do it during the next week.

potsky commented 8 years ago

I will release the production version tonight in a few hours. You will need to change the version in composer, all will be explained in the README.md on github.

potsky commented 8 years ago

Ok, the new version is released.

You need to change your composer version and set the correct package version according to your laravel version.

alariva commented 8 years ago

Hi! Just upgraded the version to 2.3 (Laravel 5.2), seems to have quite a lot of new work, but I cannot find out how to get a PSR-2 compliant output. Any hint? :)

potsky commented 8 years ago

Take a look at the latest configuration file. Given that you just upgrade your installation, you don't have the new parameters.

https://github.com/potsky/laravel-localization-helpers/blob/master/src/config/config-laravel5.php

You just have to set the level parameter to psr2 and you're ok.

alariva commented 8 years ago

Seems to be working all right. Well done!