Skip to content

Commit 641222f

Browse files
authored
Merge pull request #19 from php-fig-rectified/php7
1.0.0 prep - PHP7.2+
2 parents 3052ce7 + c536b61 commit 641222f

File tree

65 files changed

+447
-1259
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+447
-1259
lines changed

.editorconfig

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
; This file is for unifying the coding style for different editors and IDEs.
2-
; More information at http://editorconfig.org
3-
2+
; More information at https://editorconfig.org
43
root = true
54

65
[*]
@@ -16,6 +15,3 @@ end_of_line = crlf
1615
[*.yml]
1716
indent_style = space
1817
indent_size = 2
19-
20-
[*.neon]
21-
indent_style = space

.gitattributes

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
# Define the line ending behavior of the different file extensions
2-
# Set default behaviour, in case users don't have core.autocrlf set.
3-
* text=auto
4-
* text eol=lf
5-
6-
# Explicitly declare text files we want to always be normalized and converted
7-
# to native line endings on checkout.
8-
*.php text
9-
*.txt text
10-
*.xml text
11-
*.yml text
12-
.htaccess text
2+
# Set default behavior, in case users don't have core.autocrlf set.
3+
* text text=auto eol=lf
134

145
# Declare files that will always have CRLF line endings on checkout.
156
*.bat eol=crlf
@@ -18,4 +9,14 @@
189
*.pem eol=lf
1910

2011
# Denote all files that are truly binary and should not be modified.
12+
*.jpg binary
13+
*.png binary
2114
*.phar binary
15+
16+
# Remove files for archives generated using `git archive`
17+
phpunit.xml.dist export-ignore
18+
.travis.yml export-ignore
19+
.gitignore export-ignore
20+
.gitattributes export-ignore
21+
.editorconfig export-ignore
22+
tests/ export-ignore

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
/vendor/*
1+
/vendor/
22
/phpunit.phar
3-
.phpunit.result.cache
3+
/.phpunit.result.cache
44
/composer.phar
55
/composer.lock
6-
.idea
7-
clover.xml
6+
/.idea/
7+
/clover.xml

.travis.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
language: php
22

3-
sudo: false
4-
53
php:
6-
- 5.6
7-
- 7.3
8-
- 7.4snapshot
4+
- 7.2
5+
- 7.4
96

107
env:
118
global:
129
- DEFAULT=1
1310

1411
matrix:
1512
include:
16-
- php: 7.2
13+
- php: 7.3
1714
env: CHECKS=1 DEFAULT=0
1815

1916
fast_finish: true
@@ -22,7 +19,7 @@ before_script:
2219
- composer install --prefer-dist --no-interaction
2320

2421
script:
25-
- if [[ $CHECKS == 1 ]]; then composer phpstan-setup && composer phpstan ; fi
22+
- if [[ $CHECKS == 1 ]]; then composer stan ; fi
2623
- composer cs-check
2724

2825
notifications:

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2016 Mark Scherer
3+
Copyright (c) 2016-present Mark Scherer
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

PSR2R/Sniffs/Classes/ClassCreateInstanceSniff.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public function process(File $phpcsFile, $stackPtr) {
3434
// We can only invoke the fixer if we know this is a static constructor function call.
3535
if ($tokens[$constructorIndex]['code'] !== T_STRING && $tokens[$constructorIndex]['code'] !== T_NS_SEPARATOR) {
3636
$phpcsFile->addError($error, $stackPtr, 'ParenthesisMissing');
37+
3738
return;
3839
}
3940

PSR2R/Sniffs/Classes/ClassFileNameSniff.php

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@
22
/**
33
* Squiz_Sniffs_Classes_ClassFileNameSniff.
44
*
5-
* PHP version 5
6-
*
7-
* @category PHP
8-
* @package PHP_CodeSniffer
9-
* @author Greg Sherwood <gsherwood@squiz.net>
10-
* @author Marc McIntyre <mmcintyre@squiz.net>
5+
* @package PHP_CodeSniffer
6+
* @author Greg Sherwood <gsherwood@squiz.net>
7+
* @author Marc McIntyre <mmcintyre@squiz.net>
118
* @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600)
12-
* @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
13-
* @link http://pear.php.net/package/PHP_CodeSniffer
9+
* @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
10+
* @link http://pear.php.net/package/PHP_CodeSniffer
1411
*/
1512

1613
namespace PSR2R\Sniffs\Classes;
@@ -24,12 +21,12 @@
2421
* Tests that the file name and the name of the class contained within the file
2522
* match.
2623
*
27-
* @author Greg Sherwood <gsherwood@squiz.net>
28-
* @author Marc McIntyre <mmcintyre@squiz.net>
24+
* @author Greg Sherwood <gsherwood@squiz.net>
25+
* @author Marc McIntyre <mmcintyre@squiz.net>
2926
* @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600)
30-
* @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
31-
* @version Release: @package_version@
32-
* @link http://pear.php.net/package/PHP_CodeSniffer
27+
* @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
28+
* @version Release: @package_version@
29+
* @link http://pear.php.net/package/PHP_CodeSniffer
3330
*/
3431
class ClassFileNameSniff extends AbstractSniff {
3532

PSR2R/Sniffs/Classes/PropertyDeclarationSniff.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
/**
1010
* Verifies that properties are declared correctly.
1111
*
12-
* @author Greg Sherwood <gsherwood@squiz.net>
12+
* @author Greg Sherwood <gsherwood@squiz.net>
1313
* @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600)
14-
* @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
14+
* @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
1515
*
16-
* @version Release: @package_version@
16+
* @version Release: @package_version@
1717
*
18-
* @link http://pear.php.net/package/PHP_CodeSniffer
18+
* @link http://pear.php.net/package/PHP_CodeSniffer
1919
*/
2020
class PropertyDeclarationSniff extends AbstractVariableSniff {
2121

PSR2R/Sniffs/Classes/SelfAccessorSniff.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public function process(File $phpcsFile, $stackPtr) {
3131

3232
if ($tokens[$stackPtr]['code'] === T_SELF) {
3333
$this->checkSelf($phpcsFile, $stackPtr);
34+
3435
return;
3536
}
3637

@@ -50,11 +51,13 @@ public function process(File $phpcsFile, $stackPtr) {
5051
for ($i = $startIndex + 1; $i < $endIndex; $i++) {
5152
if ($tokens[$i]['code'] === T_NEW) {
5253
$this->checkNew($phpcsFile, $i, $name);
54+
5355
continue;
5456
}
5557

5658
if ($tokens[$i]['code'] === T_DOUBLE_COLON) {
5759
$this->checkDoubleColon($phpcsFile, $i, $name);
60+
5861
continue;
5962
}
6063
}
@@ -63,6 +66,7 @@ public function process(File $phpcsFile, $stackPtr) {
6366
/**
6467
* @param \PHP_CodeSniffer\Files\File $phpcsFile
6568
* @param int $stackPtr
69+
*
6670
* @return void
6771
*/
6872
protected function checkSelf(File $phpcsFile, $stackPtr) {
@@ -83,6 +87,7 @@ protected function checkSelf(File $phpcsFile, $stackPtr) {
8387
* @param \PHP_CodeSniffer\Files\File $phpcsFile
8488
* @param int $i
8589
* @param string $name
90+
*
8691
* @return void
8792
*/
8893
protected function checkNew(File $phpcsFile, $i, $name) {
@@ -104,6 +109,7 @@ protected function checkNew(File $phpcsFile, $i, $name) {
104109
* @param \PHP_CodeSniffer\Files\File $phpcsFile
105110
* @param int $index
106111
* @param string $name
112+
*
107113
* @return void
108114
*/
109115
protected function fixNameToSelf(File $phpcsFile, $index, $name) {
@@ -125,6 +131,7 @@ protected function fixNameToSelf(File $phpcsFile, $index, $name) {
125131
* @param \PHP_CodeSniffer\Files\File $phpcsFile
126132
* @param int $i
127133
* @param string $name
134+
*
128135
* @return void
129136
*/
130137
protected function checkDoubleColon(File $phpcsFile, $i, $name) {

PSR2R/Sniffs/Commenting/DocBlockParamAllowDefaultValueSniff.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public function process(File $phpCsFile, $stackPointer) {
6666

6767
if ($tokens[$classNameIndex]['type'] !== 'T_DOC_COMMENT_STRING') {
6868
$phpCsFile->addError('Missing type in param doc block', $i, 'CommentAllowDefault');
69+
6970
continue;
7071
}
7172

0 commit comments

Comments
 (0)