Skip to content

Commit

Permalink
Bumped version
Browse files Browse the repository at this point in the history
  • Loading branch information
michalbundyra committed Mar 7, 2019
2 parents a0fa4e5 + 42206b3 commit d0d09ff
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@

All notable changes to this project will be documented in this file, in reverse chronological order by release.

## 1.0.1 - TBD

### Added

- Nothing.

### Changed

- Nothing.

### Deprecated

- Nothing.

### Removed

- Nothing.

### Fixed

- Nothing.

## 1.0.0 - 2019-03-07

Initial release.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@

use const T_WHITESPACE;

/**
* - check if `=>` in array is at the end of the line (code: `AtTheEnd`)
* - check spaces before `=>` - by default expected only one space, but can
* be configured by setting `maxPadding` to align array arrows `=>` in
* multi-line arrays. New group of alignment starts when there is an empty line, line with comment or arrow
* is in new line.
* (code: `SpacesBefore`)
*/
class DoubleArrowSniff extends AbstractArraySniff
{
/**
Expand Down
22 changes: 22 additions & 0 deletions src/WebimpressCodingStandard/Sniffs/Arrays/FormatSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,28 @@
use const T_DOUBLE_ARROW;
use const T_WHITESPACE;

/**
* Single Line Arrays:
* - no spaces after opening bracket (code: `SingleLineSpaceBefore`),
* - no spaces before closing bracket (code: `SingleLineSpaceAfter`).
*
* Multiline Arrays:
* - empty array in one line: `[]` (code: `EmptyArrayInOneLine`),
* - no blank line before closing bracket (code: `BlankLineAtTheEnd`),
* - one element per line (code: `OneElementPerLine`),
* - no blank lines between elements; only allowed before comment (code: `BlankLine`):
* ```php
* $array = [
* 'elem1',
* 'elem2',
*
* // some comment
* 'key' => 'value',
* 'foo' => 'baz',
* ];
* ```
* - array closing bracket in new line (code: `ClosingBracketInNewLine`).
*/
class FormatSniff extends AbstractArraySniff
{
/**
Expand Down

0 comments on commit d0d09ff

Please sign in to comment.