Skip to content

Commit

Permalink
Raise PHPStan to level 7.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Nov 1, 2019
1 parent 70887a3 commit bd059c4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"test": "php phpunit.phar",
"test-coverage": "php phpunit.phar --log-junit tmp/coverage/unitreport.xml --coverage-html tmp/coverage --coverage-clover tmp/coverage/coverage.xml",
"test-setup": "[ ! -f phpunit.phar ] && wget https://phar.phpunit.de/phpunit.phar || true",
"phpstan": "phpstan analyse -c tests/phpstan.neon -l 5 src/",
"phpstan": "phpstan analyse -c tests/phpstan.neon -l 7 src/",
"phpstan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:\"^0.11\" && mv composer.backup composer.json",
"cs-check": "phpcs -v -p --standard=vendor/fig-r/psr2r-sniffer/PSR2R/ruleset.xml --extensions=php src/ tests/",
"cs-fix": "phpcbf -v --standard=vendor/fig-r/psr2r-sniffer/PSR2R/ruleset.xml --extensions=php src/ tests/"
Expand Down
3 changes: 3 additions & 0 deletions src/MediaEmbed.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ protected function _parseLink($url, $regex) {
}

$source = preg_replace('/[^(\x20-\x7F)]*/', '', $content);
if (!$source) {
return false;
}

if (preg_match('~' . $regex . '~imu', $source, $match)) {
$this->_match = $match;
Expand Down
8 changes: 6 additions & 2 deletions src/Object/MediaObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ public function icon() {
}

$pieces = parse_url($url);
if (!$pieces) {
return null;
}

$url = $pieces['host'];

$icon = 'http://www.google.com/s2/favicons?domain=';
Expand Down Expand Up @@ -298,7 +302,7 @@ public function setAttribute($param, $value = null) {
/**
* Set the height of the object
*
* @param mixed $height Height to set the object to
* @param int $height Height to set the object to
* @param bool $adjustWidth
* @return $this
*/
Expand All @@ -312,7 +316,7 @@ public function setHeight($height, $adjustWidth = false) {
/**
* Set the width of the object
*
* @param mixed $width Width to set the object to
* @param int $width Width to set the object to
* @param bool $adjustHeight
* @return $this
*/
Expand Down

0 comments on commit bd059c4

Please sign in to comment.