1
0
mirror of synced 2024-11-24 05:26:03 +03:00

phpcs & code quality fixes

This commit is contained in:
Pavel 2020-09-29 16:40:35 +03:00
parent 08d118a842
commit fbfca80dec
7 changed files with 39 additions and 20 deletions

1
.gitignore vendored
View File

@ -14,3 +14,4 @@ phpunit.xml
.swp .swp
/nbproject /nbproject
.env .env
.php_cs.cache

View File

@ -42,7 +42,7 @@
"phpmd": "./vendor/bin/phpmd src text controversial,design,./phpmd.xml", "phpmd": "./vendor/bin/phpmd src text controversial,design,./phpmd.xml",
"phpcs": "./vendor/bin/phpcs -p src --runtime-set testVersion 7.3", "phpcs": "./vendor/bin/phpcs -p src --runtime-set testVersion 7.3",
"phpcbf": "./vendor/bin/phpcbf -p src", "phpcbf": "./vendor/bin/phpcbf -p src",
"test": "composer run-script phpmd && composer run-script phpunit" "test": "composer run-script phpcs && composer run-script phpmd && composer run-script phpunit"
}, },
"prefer-stable": true, "prefer-stable": true,
"license": "MIT" "license": "MIT"

13
phpcs.xml.dist Normal file
View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
<arg name="basepath" value="."/>
<arg name="cache" value=".php_cs.cache"/>
<arg name="colors"/>
<arg name="extensions" value="php"/>
<rule ref="PSR2"/>
<file>src/</file>
<file>tests/</file>
</ruleset>

View File

@ -119,9 +119,12 @@ class Stream implements StreamInterface
throw $exception; throw $exception;
} }
trigger_error(sprintf( trigger_error(
sprintf(
'%s::__toString exception: %s', '%s::__toString exception: %s',
self::class, (string) $exception), self::class,
(string) $exception
),
E_USER_ERROR E_USER_ERROR
); );
} }

View File

@ -136,7 +136,9 @@ abstract class BaseRequest
* *
* @return void * @return void
*/ */
final public function setMethod(string $method): void {} final public function setMethod(string $method): void
{
}
/** /**
* Should return method name for this request. * Should return method name for this request.