phpcs & code quality fixes
This commit is contained in:
parent
08d118a842
commit
fbfca80dec
1
.gitignore
vendored
1
.gitignore
vendored
@ -14,3 +14,4 @@ phpunit.xml
|
||||
.swp
|
||||
/nbproject
|
||||
.env
|
||||
.php_cs.cache
|
||||
|
@ -42,7 +42,7 @@
|
||||
"phpmd": "./vendor/bin/phpmd src text controversial,design,./phpmd.xml",
|
||||
"phpcs": "./vendor/bin/phpcs -p src --runtime-set testVersion 7.3",
|
||||
"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,
|
||||
"license": "MIT"
|
||||
|
13
phpcs.xml.dist
Normal file
13
phpcs.xml.dist
Normal 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>
|
@ -119,9 +119,12 @@ class Stream implements StreamInterface
|
||||
throw $exception;
|
||||
}
|
||||
|
||||
trigger_error(sprintf(
|
||||
trigger_error(
|
||||
sprintf(
|
||||
'%s::__toString exception: %s',
|
||||
self::class, (string) $exception),
|
||||
self::class,
|
||||
(string) $exception
|
||||
),
|
||||
E_USER_ERROR
|
||||
);
|
||||
}
|
||||
|
@ -66,11 +66,11 @@ class SerializerFactory implements FactoryInterface
|
||||
$container = $this->container;
|
||||
|
||||
return SerializerBuilder::create()
|
||||
->configureHandlers(function(HandlerRegistry $registry) use ($container) {
|
||||
$returnNull = function($visitor, $obj, array $type) {
|
||||
->configureHandlers(function (HandlerRegistry $registry) use ($container) {
|
||||
$returnNull = function ($visitor, $obj, array $type) {
|
||||
return null;
|
||||
};
|
||||
$returnSame = function($visitor, $obj, array $type) {
|
||||
$returnSame = function ($visitor, $obj, array $type) {
|
||||
return $obj;
|
||||
};
|
||||
|
||||
@ -78,7 +78,7 @@ class SerializerFactory implements FactoryInterface
|
||||
GraphNavigatorInterface::DIRECTION_SERIALIZATION,
|
||||
'RequestDtoInterface',
|
||||
'json',
|
||||
function($visitor, $obj, array $type) use ($container) {
|
||||
function ($visitor, $obj, array $type) use ($container) {
|
||||
/** @var SerializerInterface $serializer */
|
||||
$serializer = $container->get(Constants::SERIALIZER);
|
||||
|
||||
@ -95,7 +95,7 @@ class SerializerFactory implements FactoryInterface
|
||||
GraphNavigatorInterface::DIRECTION_SERIALIZATION,
|
||||
'RequestDtoInterface',
|
||||
'xml',
|
||||
function($visitor, $obj, array $type) use ($container) {
|
||||
function ($visitor, $obj, array $type) use ($container) {
|
||||
/** @var SerializerInterface $serializer */
|
||||
$serializer = $container->get(Constants::SERIALIZER);
|
||||
|
||||
|
@ -136,7 +136,9 @@ abstract class BaseRequest
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
final public function setMethod(string $method): void {}
|
||||
final public function setMethod(string $method): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Should return method name for this request.
|
||||
|
Loading…
Reference in New Issue
Block a user