Skip to content
This repository was archived by the owner on Jan 21, 2020. It is now read-only.

Zend Coding Standard 2 #5

Closed
wants to merge 60 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
dbacd12
Import strict ruleset
geerteltink Sep 5, 2018
5863c14
Allow functions inside functions
geerteltink Sep 5, 2018
06a5606
Allow @var for constants
geerteltink Sep 5, 2018
d27454d
Allow @since for noting API additions
geerteltink Sep 5, 2018
646eea1
Allow fancy yoda conditions as a defensive programming approach
geerteltink Sep 5, 2018
fa193f3
Forbid short open tag, but allow short echo tags for use in templates
geerteltink Sep 5, 2018
f1cef3f
Add documentation structure
geerteltink Sep 5, 2018
911065a
Use xmllint to validate against schema
geerteltink Sep 5, 2018
365acdf
Remove copyright in mkdocs config as it's not being used anymore
geerteltink Sep 5, 2018
b3146a6
Remove index.html because it's generated by the theme
geerteltink Sep 5, 2018
5c86655
Disable phpunit tests until there is something to test
geerteltink Sep 5, 2018
ce7ae4a
Use PSR-12 compatible imports
geerteltink Sep 6, 2018
3f602fa
Add rules to documentation
geerteltink Sep 6, 2018
39ba67a
Add some test cases
geerteltink Sep 6, 2018
e9d9a2d
Update docs for alias functions
geerteltink Sep 6, 2018
2d29543
Document the new way to ignore parts of a file phpcs:enable phpcs:dis…
geerteltink Sep 6, 2018
2397775
Don't allow fully qualified classes from global space
geerteltink Sep 6, 2018
a063051
Add useful tests
geerteltink Sep 6, 2018
29b05a0
Fix typo in ci script
geerteltink Sep 6, 2018
d35d34e
Don't remove xdebug as php nightly doesn't have it
geerteltink Sep 6, 2018
b4d915d
Test expected violations for fixable code
geerteltink Sep 6, 2018
45d14bd
Require ? when default value is null
geerteltink Sep 6, 2018
5b00974
Improve documentation formatting
geerteltink Sep 6, 2018
dc11e2e
Add PSR-12 test cases
geerteltink Sep 6, 2018
6dc1801
Update concatenation spacing test
geerteltink Sep 6, 2018
c7718be
Update expected phpcs report
geerteltink Sep 6, 2018
7367ecd
Improve concatenation tests
geerteltink Sep 7, 2018
a88527c
Add phpcs cache for speed improvement
geerteltink Sep 7, 2018
c15e28e
Document the coding standard and all rules
geerteltink Sep 7, 2018
d044763
First set of documentation improvements and fixes
geerteltink Sep 7, 2018
f722edd
More grammar fixes
geerteltink Sep 8, 2018
ba703a4
Reorder rules and disable double rules
geerteltink Sep 8, 2018
2702288
Add missing rule: Class name resolution via ::class
geerteltink Sep 8, 2018
b9509c8
Add coding-style-guide to mkdocs config
geerteltink Sep 8, 2018
4da5772
Add changelog for #5
geerteltink Sep 8, 2018
9737c95
Improve wording and add example for Generic.Classes.DuplicateClassName
geerteltink Sep 8, 2018
7ea79cc
It's raining outside, so more examples and improved formatting
geerteltink Sep 8, 2018
70b63af
Update phpcs config in readme
geerteltink Sep 8, 2018
f93740b
Update array indentation test
geerteltink Sep 9, 2018
c531490
Don't align equal statements, double arrow arrays or phpdoc comment tags
geerteltink Sep 11, 2018
aba1c3a
Remove early exit rule as it is overly aggressive when "fixing" the code
geerteltink Sep 11, 2018
a276b18
Add references
geerteltink Sep 11, 2018
bf0d951
Update changelog with latest changes
geerteltink Sep 11, 2018
3386b02
Update intro and readme
geerteltink Sep 11, 2018
300e613
Fix creation of double trailing commas on specific arrays
geerteltink Sep 11, 2018
61f3bc5
PSR-12: Force Unix LF (linefeed) line ending
geerteltink Sep 11, 2018
ea3de20
Allow global functions
geerteltink Sep 11, 2018
53a7dcd
Align comments, statements and arrays
geerteltink Sep 19, 2018
850f481
Align array double arrows
geerteltink Sep 19, 2018
5eaa798
Validate fixes before running tests
geerteltink Sep 19, 2018
41d35b9
Fix single arrow indention test
geerteltink Sep 19, 2018
3974380
Reset array alignment and start from scratch
geerteltink Sep 20, 2018
137dc8a
Update slevomat/coding-standard requirement and add regression test for
geerteltink Sep 20, 2018
61f6b4b
Add test for constant aligning
geerteltink Sep 20, 2018
5f2280d
Align double arrows in multiline arrays
geerteltink Sep 21, 2018
a3d45d7
Update expected errors report
geerteltink Sep 21, 2018
27b735f
Require php_codesniffer 3.3.2
geerteltink Oct 6, 2018
95213b5
Update array indentation tests
geerteltink Oct 6, 2018
38a2dea
Use new format to declare array properties
geerteltink Oct 6, 2018
7dc2f78
Update phpcs report
geerteltink Oct 6, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 24 additions & 42 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,37 @@
dist: trusty
sudo: false

language: php

php:
- 7.1
- 7.2
- nightly

cache:
directories:
- $HOME/.composer/cache

env:
global:
- COMPOSER_ARGS="--no-interaction"
- COVERAGE_DEPS="php-coveralls/php-coveralls"

matrix:
include:
- php: 7.1
env:
- DEPS=lowest
- php: 7.1
env:
- DEPS=locked
- CS_CHECK=true
- TEST_COVERAGE=true
- php: 7.1
env:
- DEPS=latest
- php: 7.2
env:
- DEPS=lowest
- php: 7.2
env:
- DEPS=locked
- php: 7.2
env:
- DEPS=latest
- $HOME/.composer/cache

before_install:
- if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
- phpenv config-rm xdebug.ini
- composer self-update

install: travis_retry composer update --prefer-dist

install:
- travis_retry composer install $COMPOSER_ARGS
- if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi
- if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi
- stty cols 120 && composer show
stages:
- Validate against schema
- Test

script:
- if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi
- if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi
jobs:
allow_failures:
- php: nightly

after_script:
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry php vendor/bin/php-coveralls -v ; fi
include:
- stage: Validate against schema
addons:
apt:
packages:
- libxml2-utils
script: xmllint --noout --schema vendor/squizlabs/php_codesniffer/phpcs.xsd src/ZendCodingStandard/ruleset.xml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! 👍


notifications:
email: false