Skip to content
This repository has been archived by the owner on Apr 28, 2024. It is now read-only.

Commit

Permalink
Updated Style Guide
Browse files Browse the repository at this point in the history
  • Loading branch information
lcharette committed Jan 13, 2019
1 parent 472ac0f commit f544343
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Change Log
# Changelog

All notable changes to this project will be documented in this file.

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,7 @@ print_r($session->all());
$session->destroy();
```

## [Style Guide](STYLE-GUIDE.md)

<!-- ## [Testing](RUNNING_TESTS.md) -->
23 changes: 11 additions & 12 deletions STYLE-GUIDE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Style guide for contributing to userfrosting/i18n
# Style guide for contributing

## PHP

Expand All @@ -13,11 +13,11 @@ In addition:

```
/**
* UserFrosting i18n (http://www.userfrosting.com)
* UserFrosting Session (http://www.userfrosting.com)
*
* @link https://github.com/userfrosting/i18n
* @copyright Copyright (c) 2013-2019 Alexander Weissman, Louis Charette
* @license https://github.com/userfrosting/i18n/blob/master/LICENSE.md (MIT License)
* @link https://github.com/userfrosting/session
* @copyright Copyright (c) 2019 Alexander Weissman
* @license https://github.com/userfrosting/session/blob/master/LICENSE.md (MIT License)
*/
```

Expand All @@ -39,13 +39,12 @@ In addition:
- Array keys MUST NOT contain `.`. This is because `.` is a reserved operator in Laravel and Twig's [dot syntax](https://medium.com/@assertchris/dot-notation-3fd3e42edc61).
- Multidimensional arrays SHOULD be referenced using dot syntax whenever possible. So, instead of doing `$myArray['person1']['email']`, you should use `$myArray['person1.email']` if your array structure supports it.

## Automatically fixing coding style with PHP-CS-Fixer

## Automatically fixing coding style with PHP-CS-Fixer
[PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) can be used to automatically fix PHP code styling. UserFrosting provides a project specific configuration file ([`.php_cs`](.php_cs)) with a set of rules reflecting our style guidelines. This tool should be used before submitting any code change to assure the style guidelines are met. Every sprinkles will also be parsed by the fixer.

[PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) can be used to automatically fix PHP code styling. UserFrosting provides a project specific configuration file ([`.php_cs`](.php_cs)) with a set of rules reflecting our style guidelines. This tool should be used before submitting any code change to assure the style guidelines are met. Every sprinkles will also be parsed by the fixer.
PHP-CS-Fixer is automatically loaded by Composer and can be used from the UserFrosting root directory :

PHP-CS-Fixer is automatically loaded by Composer and can be used from the UserFrosting root directory :

```
vendor/bin/php-cs-fixer fix
```
```
vendor/bin/php-cs-fixer fix
```

0 comments on commit f544343

Please sign in to comment.