Skip to content

Commit 3c0289b

Browse files
authored
Merge pull request #46 from j0k3r/phpstan
Enable PHPStan
2 parents 6a0f333 + 74d9cc6 commit 3c0289b

File tree

7 files changed

+151
-121
lines changed

7 files changed

+151
-121
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
/README.md export-ignore
88
/phpunit.xml.dist export-ignore
99
/tests export-ignore
10+
/phpstan.neon export-ignore

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@ install:
2929
- composer self-update
3030

3131
before_script:
32+
- if [ "$CS_FIXER" = "run" ]; then composer require phpstan/phpstan phpstan/phpstan-phpunit --dev -n ; fi;
3233
- composer install -o --prefer-dist --no-interaction
3334

3435
script:
3536
- mkdir -p build/logs
3637
- php vendor/bin/simple-phpunit -v --coverage-clover build/logs/clover.xml
3738
- if [ "$CS_FIXER" = "run" ]; then php vendor/bin/php-cs-fixer fix --verbose --dry-run ; fi;
39+
- if [ "$CS_FIXER" = "run" ]; then php vendor/bin/phpstan analyse src tests --no-progress --level 1 ; fi;
3840

3941
after_script:
4042
- php vendor/bin/php-coveralls -v -x build/logs/clover.xml

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,8 @@
4040
},
4141
"autoload": {
4242
"psr-4": { "Readability\\": "src/" }
43+
},
44+
"autoload-dev": {
45+
"psr-4": { "Tests\\Readability\\": "tests/" }
4346
}
4447
}

phpstan.neon

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
includes:
2+
- vendor/phpstan/phpstan-phpunit/extension.neon
3+
- vendor/phpstan/phpstan-phpunit/rules.neon
4+
5+
parameters:
6+
# https://github.com/phpstan/phpstan/issues/694#issuecomment-350724288
7+
autoload_files:
8+
- vendor/bin/.phpunit/phpunit-6.5/vendor/autoload.php

src/JSLikeHTMLElement.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,14 @@ public function __toString()
127127
{
128128
return '[' . $this->tagName . ']';
129129
}
130+
131+
public function getInnerHtml()
132+
{
133+
return $this->__get('innerHTML');
134+
}
135+
136+
public function setInnerHtml($value)
137+
{
138+
return $this->__set('innerHTML', $value);
139+
}
130140
}

0 commit comments

Comments
 (0)