Skip to content

Commit 5f0edab

Browse files
author
Christian Blanquera
authored
Merge pull request #4 from phpugph/1.0
psr-2 fixes
2 parents 5f0db64 + 24cae0d commit 5f0edab

File tree

5 files changed

+39
-16
lines changed

5 files changed

+39
-16
lines changed

.travis.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
language: php
22
php:
3-
- 7.1
3+
- 8.0
4+
env:
5+
global:
6+
- XDEBUG_MODE=coverage
47
install:
5-
- /home/travis/.phpenv/versions/7.1/bin/composer install
8+
- /home/travis/.phpenv/versions/8.0/bin/composer install
69
- phpenv rehash
710
before_script:
811
- mkdir -p build/logs
912
script:
1013
- vendor/bin/phpcs
11-
- vendor/bin/phpunit --coverage-clover build/logs/clover.xml
14+
- XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-clover build/logs/clover.xml
1215
- php vendor/bin/php-coveralls -v

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
],
88
"license": "MIT",
99
"require-dev": {
10-
"phpunit/phpunit": "^9.5.4",
11-
"squizlabs/php_codesniffer": "^3.5.8",
12-
"php-coveralls/php-coveralls": "^2.4.3"
10+
"phpunit/phpunit": "~9.5.4",
11+
"squizlabs/php_codesniffer": "~3.5.8",
12+
"php-coveralls/php-coveralls": "~2.4.3"
1313
},
1414
"require": {
15-
"phpugph/components": "^1.0.0"
15+
"phpugph/components": "~1.0.0"
1616
},
1717
"autoload": {
1818
"psr-4": {

phpcs.xml

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,32 @@
11
<?xml version="1.0"?>
22
<ruleset name="PHP_CodeSniffer">
3-
<description>The coding standard for PHP_CodeSniffer itself.</description>
3+
<description>The coding standard for PHP_CodeSniffer itself.</description>
44

5-
<file>src</file>
5+
<file>src</file>
66

7-
<arg name="report" value="full"/>
8-
<arg value="np"/>
7+
<arg name="report" value="full"/>
8+
<arg value="np"/>
9+
<arg name="tab-width" value="2"/>
910

10-
<rule ref="PSR2"/>
11-
</ruleset>
11+
<rule ref="PSR2"/>
12+
<rule ref="Generic.WhiteSpace.ScopeIndent">
13+
<properties>
14+
<property name="indent" value="2"/>
15+
</properties>
16+
</rule>
17+
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration">
18+
<properties>
19+
<property name="indent" value="2" />
20+
</properties>
21+
</rule>
22+
<rule ref="PSR2.Methods.FunctionCallSignature">
23+
<properties>
24+
<property name="indent" value="2" />
25+
</properties>
26+
</rule>
27+
<rule ref="PSR2.ControlStructures.SwitchDeclaration">
28+
<properties>
29+
<property name="indent" value="2" />
30+
</properties>
31+
</rule>
32+
</ruleset>

phpunit.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
</testsuite>
2222
</testsuites>
2323

24-
<coverage>
24+
<coverage processUncoveredFiles="false" pathCoverage="true">
2525
<include>
2626
<directory suffix=".php">./src</directory>
2727
</include>

src/HandlebarsTokenizer.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,7 @@ protected function findVariable($i, $escape)
248248
$close = $close . $this->bars[1];
249249
}
250250

251-
for (; substr($this->source, $i, strlen($close)) !== $close;
252-
$i++) {
251+
for (; substr($this->source, $i, strlen($close)) !== $close; $i++) {
253252
}
254253

255254
return $i + strlen($close);

0 commit comments

Comments
 (0)