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

Commit d52e3a7

Browse files
committed
Merge pull request #46 from mikeSimonson/win-eol-fix
Trying to fix a platform issue with windows line ending
2 parents 2b2984d + 9d1f325 commit d52e3a7

File tree

13 files changed

+30
-23
lines changed

13 files changed

+30
-23
lines changed

phpcs.xml.dist

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
<property name="ignoreBlankLines" value="false"/>
1515
</properties>
1616
</rule>
17+
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingAfterOpen">
18+
<severity>0</severity>
19+
</rule>
20+
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose">
21+
<severity>0</severity>
22+
</rule>
23+
1724

1825
<!-- Paths to check -->
1926
<file>src</file>

src/Generator/MethodGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ protected static function clearBodyIndention($body)
9393
return $body;
9494
}
9595

96-
$lines = explode(PHP_EOL, $body);
96+
$lines = explode("\n", $body);
9797

9898
$indention = str_replace(trim($lines[1]), '', $lines[1]);
9999

@@ -103,7 +103,7 @@ protected static function clearBodyIndention($body)
103103
}
104104
}
105105

106-
$body = implode(PHP_EOL, $lines);
106+
$body = implode("\n", $lines);
107107

108108
return $body;
109109
}

src/Reflection/DocBlock/Tag/AuthorTag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,6 @@ public function getAuthorEmail()
6969

7070
public function __toString()
7171
{
72-
return 'DocBlock Tag [ * @' . $this->getName() . ' ]' . PHP_EOL;
72+
return 'DocBlock Tag [ * @' . $this->getName() . ' ]' . "\n";
7373
}
7474
}

src/Reflection/DocBlock/Tag/GenericTag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function returnValue($position)
9595
*/
9696
public function __toString()
9797
{
98-
return 'DocBlock Tag [ * @' . $this->name . ' ]' . PHP_EOL;
98+
return 'DocBlock Tag [ * @' . $this->name . ' ]' . "\n";
9999
}
100100

101101
/**

src/Reflection/DocBlock/Tag/LicenseTag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,6 @@ public function getLicenseName()
6969

7070
public function __toString()
7171
{
72-
return 'DocBlock Tag [ * @' . $this->getName() . ' ]' . PHP_EOL;
72+
return 'DocBlock Tag [ * @' . $this->getName() . ' ]' . "\n";
7373
}
7474
}

src/Reflection/DocBlock/Tag/MethodTag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,6 @@ public function isStatic()
117117

118118
public function __toString()
119119
{
120-
return 'DocBlock Tag [ * @' . $this->getName() . ' ]' . PHP_EOL;
120+
return 'DocBlock Tag [ * @' . $this->getName() . ' ]' . "\n";
121121
}
122122
}

src/Reflection/DocBlock/Tag/PropertyTag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,6 @@ public function getDescription()
9595

9696
public function __toString()
9797
{
98-
return 'DocBlock Tag [ * @' . $this->getName() . ' ]' . PHP_EOL;
98+
return 'DocBlock Tag [ * @' . $this->getName() . ' ]' . "\n";
9999
}
100100
}

src/Reflection/DocBlockReflection.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,15 +271,15 @@ protected function reflect()
271271
*/
272272
public function toString()
273273
{
274-
$str = "DocBlock [ /* DocBlock */ ] {" . PHP_EOL . PHP_EOL;
275-
$str .= " - Tags [" . count($this->tags) . "] {" . PHP_EOL;
274+
$str = "DocBlock [ /* DocBlock */ ] {" . "\n" . "\n";
275+
$str .= " - Tags [" . count($this->tags) . "] {" . "\n";
276276

277277
foreach ($this->tags as $tag) {
278278
$str .= " " . $tag;
279279
}
280280

281-
$str .= " }" . PHP_EOL;
282-
$str .= "}" . PHP_EOL;
281+
$str .= " }" . "\n";
282+
$str .= "}" . "\n";
283283

284284
return $str;
285285
}

test/Generator/TestAsset/TestClassWithManyProperties.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class TestClassWithManyProperties
3636
array(
3737
'bar',
3838
'baz',
39-
//PHP_EOL
39+
"\n"
4040
)
4141
);
4242

test/Reflection/DocBlockReflectionTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,14 @@ public function testToString()
144144

145145
$classDocBlock = $classReflection->getDocBlock();
146146

147-
$expectedString = 'DocBlock [ /* DocBlock */ ] {' . PHP_EOL
148-
. PHP_EOL
149-
. ' - Tags [3] {' . PHP_EOL
150-
. ' DocBlock Tag [ * @author ]' . PHP_EOL
151-
. ' DocBlock Tag [ * @method ]' . PHP_EOL
152-
. ' DocBlock Tag [ * @property ]' . PHP_EOL
153-
. ' }' . PHP_EOL
154-
. '}' . PHP_EOL;
147+
$expectedString = 'DocBlock [ /* DocBlock */ ] {' . "\n"
148+
. "\n"
149+
. ' - Tags [3] {' . "\n"
150+
. ' DocBlock Tag [ * @author ]' . "\n"
151+
. ' DocBlock Tag [ * @method ]' . "\n"
152+
. ' DocBlock Tag [ * @property ]' . "\n"
153+
. ' }' . "\n"
154+
. '}' . "\n";
155155

156156
$this->assertEquals($expectedString, (string) $classDocBlock);
157157
}

0 commit comments

Comments
 (0)