Skip to content

Commit a362d45

Browse files
committed
Merge branch 'master' into report-memory-improvements
Conflicts: CodeSniffer/Reports/VersionControl.php package.xml
2 parents 580e888 + d26daa8 commit a362d45

File tree

4 files changed

+53
-6
lines changed

4 files changed

+53
-6
lines changed

CodeSniffer/CLI.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,9 @@ public function process($values=array())
514514
{
515515
if (empty($values) === true) {
516516
$values = $this->getCommandLineValues();
517+
} else {
518+
$values = array_merge($this->getDefaults(), $values);
519+
$this->values = $values;
517520
}
518521

519522
if ($values['generator'] !== '') {

CodeSniffer/Reports/VersionControl.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,12 @@ public function generateFileReport(
8080
$blames = $this->getBlameContent($report['filename']);
8181

8282
foreach ($report['messages'] as $line => $lineErrors) {
83-
$author = $this->getAuthor($blames[($line - 1)]);
84-
if ($author === false) {
85-
continue;
83+
$author = 'Unknown';
84+
if (isset($blames[($line - 1)]) === true) {
85+
$blameAuthor = $this->getAuthor($blames[($line - 1)]);
86+
if ($blameAuthor !== false) {
87+
$author = $blameAuthor;
88+
}
8689
}
8790

8891
if (isset($this->_authorCache[$author]) === false) {
@@ -117,8 +120,8 @@ public function generateFileReport(
117120
// all the lines that do not have errors.
118121
foreach ($blames as $line) {
119122
$author = $this->getAuthor($line);
120-
if (false === $author) {
121-
continue;
123+
if ($author === false) {
124+
$author = 'Unknown';
122125
}
123126

124127
if (isset($this->_authorCache[$author]) === false) {

CodeSniffer/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,8 +782,9 @@ protected function processVersion($errorPos)
782782
} else if (strstr($content, 'CVS:') === false
783783
&& strstr($content, 'SVN:') === false
784784
&& strstr($content, 'GIT:') === false
785+
&& strstr($content, 'HG:') === false
785786
) {
786-
$error = 'Invalid version "%s" in file comment; consider "CVS: <cvs_id>" or "SVN: <svn_id>" or "GIT: <git_id>" instead';
787+
$error = 'Invalid version "%s" in file comment; consider "CVS: <cvs_id>" or "SVN: <svn_id>" or "GIT: <git_id>" or "HG: <hg_id>" instead';
787788
$data = array($content);
788789
$this->currentFile->addWarning($error, $errorPos, 'InvalidVersion', $data);
789790
}

package.xml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,17 @@ http://pear.php.net/dtd/package-2.0.xsd">
3939
- Comment parser now supports non-English characters when splitting comment lines into words
4040
-- Thanks to Nik Sun for the patch
4141
- Exit statements are now recognised as valid closers for CASE and DEFAULT blocks
42+
-- Thanks to Maksim Kochkin for the patch
43+
- PHP_CodeSniffer_CLI::process() can now be passed an incomplete array of CLI values
44+
-- Missing values will be set to the CLI defaults
45+
-- Thanks to Maksim Kochkin for the patch
4246
- Fixed bug #20093 : Bug with ternary operator token
4347
- Fixed bug #20097 : CLI.php throws error in php 5.2
4448
- Fixed bug #20100 : incorrect Function mysql() has been deprecated report
49+
- Fixed bug #20119 : PHP warning: invalid argument to str_repeat() in SVN blame report with -s
4550
- Fixed bug #20123 : PSR2 complains about an empty second statement in for-loop
51+
- Fixed bug #20131 : PHP errors in svnblame report, if there are files not under version control
52+
- Fixed bug #20133 : Allow "HG: hg_id" as value for @version tag
4653
</notes>
4754
<contents>
4855
<dir name="/">
@@ -2458,6 +2465,39 @@ http://pear.php.net/dtd/package-2.0.xsd">
24582465
- Multi-file sniff support has been removed because they are too memory intensive
24592466
-- If you have a custom multi-file sniff, you can convert it into a standard sniff quite easily
24602467
-- See CodeSniffer/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php for an example
2468+
</notes>
2469+
</release>
2470+
<release>
2471+
<version>
2472+
<release>1.4.8</release>
2473+
<api>1.4.8</api>
2474+
</version>
2475+
<stability>
2476+
<release>stable</release>
2477+
<api>stable</api>
2478+
</stability>
2479+
<date>2013-11-26</date>
2480+
<license uri="https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt">BSD License</license>
2481+
<notes>
2482+
- Generic ScopeIndentSniff now allows for ignored tokens to be set via ruleset.xml files
2483+
-- E.g., to ignore comments, override a property using:
2484+
-- name="ignoreIndentationTokens" type="array" value="T_COMMENT,T_DOC_COMMENT"
2485+
- PSR2 standard now ignores comments when checking indentation rules
2486+
- Squiz OperatorSpacingSniff no longer throws errors for the ?: short ternary operator
2487+
-- Thanks to Antoine Musso for the patch
2488+
- Comment parser now supports non-English characters when splitting comment lines into words
2489+
-- Thanks to Nik Sun for the patch
2490+
- Exit statements are now recognised as valid closers for CASE and DEFAULT blocks
2491+
-- Thanks to Maksim Kochkin for the patch
2492+
- PHP_CodeSniffer_CLI::process() can now be passed an incomplete array of CLI values
2493+
-- Missing values will be set to the CLI defaults
2494+
-- Thanks to Maksim Kochkin for the patch
2495+
- Fixed bug #20097 : CLI.php throws error in php 5.2
2496+
- Fixed bug #20100 : incorrect Function mysql() has been deprecated report
2497+
- Fixed bug #20119 : PHP warning: invalid argument to str_repeat() in SVN blame report with -s
2498+
- Fixed bug #20123 : PSR2 complains about an empty second statement in for-loop
2499+
- Fixed bug #20131 : PHP errors in svnblame report, if there are files not under version control
2500+
- Fixed bug #20133 : Allow "HG: hg_id" as value for @version tag
24612501
</notes>
24622502
</release>
24632503
<release>

0 commit comments

Comments
 (0)