Skip to content

Commit ec2a3df

Browse files
committed
Fixing merge conflicts
2 parents bae8e07 + 8b6a23f commit ec2a3df

File tree

94 files changed

+694
-245
lines changed

Some content is hidden

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

94 files changed

+694
-245
lines changed

.gitattributes

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
/tests export-ignore
2+
/CodeSniffer/Standards/Generic/Tests export-ignore
3+
/CodeSniffer/Standards/MySource/Tests export-ignore
4+
/CodeSniffer/Standards/PEAR/Tests export-ignore
5+
/CodeSniffer/Standards/PSR1/Tests export-ignore
6+
/CodeSniffer/Standards/PSR2/Tests export-ignore
7+
/CodeSniffer/Standards/Squiz/Tests export-ignore
8+
/CodeSniffer/Standards/Zend/Tests export-ignore
29
.travis.yml export-ignore
310
package.xml export-ignore

CodeSniffer.conf

Lines changed: 0 additions & 4 deletions
This file was deleted.

CodeSniffer.php

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ public function setTokenListeners($standard, array $sniffs=array())
641641
include_once $file;
642642

643643
// Support the use of PHP namespaces. If the class name we included
644-
// contains namespace seperators instead of underscores, use this as the
644+
// contains namespace separators instead of underscores, use this as the
645645
// class name from now on.
646646
$classNameNS = str_replace('_', '\\', $className);
647647
if (class_exists($classNameNS, false) === true) {
@@ -966,7 +966,7 @@ public function populateTokenListeners()
966966

967967
foreach ($this->sniffs as $listenerClass) {
968968
// Work out the internal code for this sniff. Detect usage of namespace
969-
// seperators instead of underscores to support PHP namespaces.
969+
// separators instead of underscores to support PHP namespaces.
970970
if (strstr($listenerClass, '\\') === false) {
971971
$parts = explode('_', $listenerClass);
972972
} else {
@@ -1074,7 +1074,7 @@ public function getFilesToProcess($paths, $local=false)
10741074
}
10751075

10761076
foreach ($di as $file) {
1077-
// Check if the file exists after all symlinks are reolved.
1077+
// Check if the file exists after all symlinks are resolved.
10781078
$filePath = realpath($file->getPathname());
10791079
if ($filePath === false) {
10801080
continue;
@@ -1176,7 +1176,7 @@ public function shouldIgnoreFile($path, $basedir)
11761176
'*' => '.*',
11771177
);
11781178

1179-
// We assume a / directory seperator, as do the exclude rules
1179+
// We assume a / directory separator, as do the exclude rules
11801180
// most developers write, so we need a special case for any system
11811181
// that is different.
11821182
if (DIRECTORY_SEPARATOR === '\\') {
@@ -1438,7 +1438,7 @@ public function getTokenSniffs()
14381438
* Takes a token produced from <code>token_get_all()</code> and produces a
14391439
* more uniform token.
14401440
*
1441-
* Note that this method also resolves T_STRING tokens into more descrete
1441+
* Note that this method also resolves T_STRING tokens into more discrete
14421442
* types, therefore there is no need to call resolveTstringToken()
14431443
*
14441444
* @param string|array $token The token to convert.
@@ -1651,7 +1651,7 @@ public static function resolveSimpleToken($token)
16511651
* character must be an underscore. This
16521652
* argument is only applicable if $classFormat
16531653
* is false.
1654-
* @param boolean $strict If true, the string must not have two captial
1654+
* @param boolean $strict If true, the string must not have two capital
16551655
* letters next to each other. If false, a
16561656
* relaxed camel caps policy is used to allow
16571657
* for acronyms.
@@ -1686,14 +1686,14 @@ public static function isCamelCaps(
16861686
}
16871687

16881688
if ($strict === true) {
1689-
// Check that there are not two captial letters next to each other.
1689+
// Check that there are not two capital letters next to each other.
16901690
$length = strlen($string);
16911691
$lastCharWasCaps = $classFormat;
16921692

16931693
for ($i = 1; $i < $length; $i++) {
16941694
$ascii = ord($string{$i});
16951695
if ($ascii >= 48 && $ascii <= 57) {
1696-
// The character is a number, so it cant be a captial.
1696+
// The character is a number, so it cant be a capital.
16971697
$isCaps = false;
16981698
} else {
16991699
if (strtoupper($string{$i}) === $string{$i}) {
@@ -1966,7 +1966,11 @@ public static function setConfigData($key, $value, $temp=false)
19661966
{
19671967
if ($temp === false) {
19681968
$configFile = dirname(__FILE__).'/CodeSniffer.conf';
1969-
if (is_file($configFile) === false) {
1969+
if (is_file($configFile) === false
1970+
&& strpos('@data_dir@', '@data_dir') === false
1971+
) {
1972+
// If data_dir was replaced, this is a PEAR install and we can
1973+
// use the PEAR data dir to store the conf file.
19701974
$configFile = '@data_dir@/PHP_CodeSniffer/CodeSniffer.conf';
19711975
}
19721976

CodeSniffer/CommentParser/AbstractDocElement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ abstract class PHP_CodeSniffer_CommentParser_AbstractDocElement implements PHP_C
100100
protected $phpcsFile = null;
101101

102102
/**
103-
* The tag that this element represents (omiting the @ symbol).
103+
* The tag that this element represents (omitting the @ symbol).
104104
*
105105
* @var string
106106
*/

CodeSniffer/CommentParser/AbstractParser.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@
4242
* </ul>
4343
*
4444
* Extending classes should implement the getAllowedTags() method to return the
45-
* tags that they wish to process, ommiting the tags that this base class
45+
* tags that they wish to process, omitting the tags that this base class
4646
* processes. When one of these tags in encountered, the process&lt;tag_name&gt;
4747
* method is called on that class. For example, if a parser's getAllowedTags()
4848
* method returns \@param as one of its tags, the processParam method will be
4949
* called so that the parser can process such a tag.
5050
*
5151
* The method is passed the tokens that comprise this tag. The tokens array
52-
* includes the whitespace that exists between the tokens, as seperate tokens.
52+
* includes the whitespace that exists between the tokens, as separate tokens.
5353
* It's up to the method to create a element that implements the DocElement
5454
* interface, which should be returned. The AbstractDocElement class is a helper
5555
* class that can be used to handle most of the parsing of the tokens into their
@@ -260,7 +260,7 @@ private function _parse($comment)
260260
* @return void
261261
* @see _parse()
262262
* @throws PHP_CodeSniffer_CommentParser_ParserException If more than the allowed
263-
* number of occurances of
263+
* number of occurences of
264264
* a tag is found.
265265
*/
266266
private function _parseWords()
@@ -424,7 +424,7 @@ protected function parseSee($tokens)
424424
/**
425425
* Parses the comment element that appears at the top of the doc comment.
426426
*
427-
* @param array(string) $tokens The word tokens that comprise tihs element.
427+
* @param array(string) $tokens The word tokens that comprise this element.
428428
*
429429
* @return DocElement The element that represents this comment element.
430430
*/
@@ -444,7 +444,7 @@ protected function parseComment($tokens)
444444
/**
445445
* Parses \@deprecated tags.
446446
*
447-
* @param array(string) $tokens The word tokens that comprise tihs element.
447+
* @param array(string) $tokens The word tokens that comprise this element.
448448
*
449449
* @return DocElement The element that represents this deprecated tag.
450450
*/
@@ -598,7 +598,7 @@ public function getSince()
598598
/**
599599
* Parses the specified tag.
600600
*
601-
* @param string $tag The tag name to parse (omitting the @ sybmol from
601+
* @param string $tag The tag name to parse (omitting the @ symbol from
602602
* the tag)
603603
* @param int $start The position in the word tokens where this element
604604
* started.
@@ -647,7 +647,7 @@ protected function parseTag($tag, $start, $end)
647647
*
648648
* Each tag should indicate if only one entry of this tag can exist in the
649649
* comment by specifying true as the array value, or false if more than one
650-
* is allowed. Each tag should ommit the @ symbol. Only tags other than
650+
* is allowed. Each tag should omit the @ symbol. Only tags other than
651651
* the standard tags should be returned.
652652
*
653653
* @return array(string => boolean)

CodeSniffer/CommentParser/CommentElement.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,19 @@ class PHP_CodeSniffer_CommentParser_CommentElement extends PHP_CodeSniffer_Comme
5151
/**
5252
* Constructs a PHP_CodeSniffer_CommentParser_CommentElement.
5353
*
54-
* @param PHP_CodeSniffer_CommentParser_DocElemement $previousElement The element
55-
* that
56-
* appears
57-
* before this
58-
* element.
59-
* @param array $tokens The tokens
60-
* that make
61-
* up this
62-
* element.
63-
* @param PHP_CodeSniffer_File $phpcsFile The file
64-
* that this
65-
* element is
66-
* in.
54+
* @param PHP_CodeSniffer_CommentParser_DocElement $previousElement The element
55+
* that
56+
* appears
57+
* before this
58+
* element.
59+
* @param array $tokens The tokens
60+
* that make
61+
* up this
62+
* element.
63+
* @param PHP_CodeSniffer_File $phpcsFile The file
64+
* that this
65+
* element is
66+
* in.
6767
*/
6868
public function __construct(
6969
$previousElement,

CodeSniffer/CommentParser/DocElement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function getLine();
9292

9393

9494
/**
95-
* Returns the raw content of this element, ommiting the tag.
95+
* Returns the raw content of this element, omitting the tag.
9696
*
9797
* @return string
9898
*/

CodeSniffer/CommentParser/FunctionCommentParser.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function __construct($comment, PHP_CodeSniffer_File $phpcsFile)
8686
/**
8787
* Parses parameter elements.
8888
*
89-
* @param array(string) $tokens The tokens that conmpise this sub element.
89+
* @param array(string) $tokens The tokens that comprise this sub element.
9090
*
9191
* @return PHP_CodeSniffer_CommentParser_ParameterElement
9292
*/
@@ -107,7 +107,7 @@ protected function parseParam($tokens)
107107
/**
108108
* Parses return elements.
109109
*
110-
* @param array(string) $tokens The tokens that conmpise this sub element.
110+
* @param array(string) $tokens The tokens that comprise this sub element.
111111
*
112112
* @return PHP_CodeSniffer_CommentParser_PairElement
113113
*/
@@ -129,7 +129,7 @@ protected function parseReturn($tokens)
129129
/**
130130
* Parses throws elements.
131131
*
132-
* @param array(string) $tokens The tokens that conmpise this sub element.
132+
* @param array(string) $tokens The tokens that comprise this sub element.
133133
*
134134
* @return PHP_CodeSniffer_CommentParser_PairElement
135135
*/
@@ -164,7 +164,7 @@ public function getParams()
164164

165165

166166
/**
167-
* Returns the return element in this fucntion comment.
167+
* Returns the return element in this function comment.
168168
*
169169
* Returns null if no return element exists in the comment.
170170
*
@@ -178,7 +178,7 @@ public function getReturn()
178178

179179

180180
/**
181-
* Returns the throws elements in this fucntion comment.
181+
* Returns the throws elements in this function comment.
182182
*
183183
* Returns empty array if no throws elements in the comment.
184184
*

CodeSniffer/CommentParser/PairElement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public function getComment()
155155

156156

157157
/**
158-
* Returns the witespace before the content of this tag.
158+
* Returns the whitespace before the content of this tag.
159159
*
160160
* @return string
161161
*/

CodeSniffer/CommentParser/ParameterElement.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public function getComment()
193193
/**
194194
* Returns the whitespace before the variable type.
195195
*
196-
* @return stirng
196+
* @return string
197197
* @see getWhiteSpaceBeforeVarName()
198198
* @see getWhiteSpaceBeforeComment()
199199
*/
@@ -233,7 +233,7 @@ public function getWhiteSpaceBeforeComment()
233233

234234

235235
/**
236-
* Returns the postition of this parameter are it appears in the comment.
236+
* Returns the position of this parameter are it appears in the comment.
237237
*
238238
* This method differs from getOrder as it is only relative to method
239239
* parameters.
@@ -291,6 +291,10 @@ public function alignsCommentWith(
291291
PHP_CodeSniffer_CommentParser_ParameterElement $other
292292
) {
293293
// Compares the index before param comment.
294+
if (strlen($other->_commentWhitespace) === 0 && strlen($this->_commentWhitespace) === 0) {
295+
return true;
296+
}
297+
294298
$otherComment
295299
= (strlen($other->_varName) + strlen($other->_commentWhitespace));
296300
$thisComment

0 commit comments

Comments
 (0)