add phpmd
This commit is contained in:
parent
5edca2bfd2
commit
08d118a842
@ -39,8 +39,10 @@
|
||||
},
|
||||
"scripts": {
|
||||
"phpunit": "./vendor/bin/phpunit -c phpunit.xml.dist",
|
||||
"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"
|
||||
"phpcbf": "./vendor/bin/phpcbf -p src",
|
||||
"test": "composer run-script phpmd && composer run-script phpunit"
|
||||
},
|
||||
"prefer-stable": true,
|
||||
"license": "MIT"
|
||||
|
39
phpmd.xml
Normal file
39
phpmd.xml
Normal file
@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ruleset name="Ruleset"
|
||||
xmlns="http://pmd.sf.net/ruleset/1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
|
||||
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
|
||||
<description>Ruleset</description>
|
||||
<rule ref="rulesets/naming.xml">
|
||||
<exclude name="ShortVariable" />
|
||||
<exclude name="LongVariable" />
|
||||
</rule>
|
||||
<rule ref="rulesets/cleancode.xml">
|
||||
<exclude name="StaticAccess" />
|
||||
<exclude name="ElseExpression" />
|
||||
</rule>
|
||||
<rule ref="rulesets/unusedcode.xml">
|
||||
<exclude name="UnusedFormalParameter" />
|
||||
</rule>
|
||||
<rule ref="rulesets/codesize.xml">
|
||||
<exclude name="TooManyPublicMethods" />
|
||||
</rule>
|
||||
<rule ref="rulesets/codesize.xml/TooManyPublicMethods">
|
||||
<properties>
|
||||
<property name="maxmethods" value="15" />
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="rulesets/naming.xml/ShortVariable">
|
||||
<properties>
|
||||
<property name="minimum" value="2" />
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="rulesets/naming.xml/LongVariable">
|
||||
<properties>
|
||||
<property name="maximum" value="30" />
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<exclude-pattern>tests/*</exclude-pattern>
|
||||
</ruleset>
|
@ -6,7 +6,7 @@
|
||||
* @category ClientBuilder
|
||||
* @package RetailCrm\Builder
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -30,7 +30,7 @@ use RetailCrm\Traits\ContainerAwareTrait;
|
||||
* @category ClientBuilder
|
||||
* @package RetailCrm\Builder
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category ContainerBuilder
|
||||
* @package RetailCrm\Builder
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -31,6 +31,7 @@ use RetailCrm\Interfaces\RequestTimestampProviderInterface;
|
||||
use RetailCrm\Service\RequestDataFilter;
|
||||
use RetailCrm\Service\RequestSigner;
|
||||
use RetailCrm\Service\RequestTimestampProvider;
|
||||
use RuntimeException;
|
||||
use Shieldon\Psr17\StreamFactory;
|
||||
use Symfony\Component\Validator\Validation;
|
||||
use Symfony\Component\Validator\Validator\TraceableValidator;
|
||||
@ -42,9 +43,12 @@ use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
* @category ContainerBuilder
|
||||
* @package RetailCrm\Builder
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*
|
||||
* ContainerBuilder should be like that.
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class ContainerBuilder implements BuilderInterface
|
||||
{
|
||||
@ -121,7 +125,7 @@ class ContainerBuilder implements BuilderInterface
|
||||
$this->setDevServices($container);
|
||||
break;
|
||||
default:
|
||||
throw new \RuntimeException(sprintf('Invalid environment type: %s', $this->env));
|
||||
throw new RuntimeException(sprintf('Invalid environment type: %s', $this->env));
|
||||
}
|
||||
|
||||
return $container;
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category AppData
|
||||
* @package RetailCrm\Component
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -21,7 +21,7 @@ use Symfony\Component\Validator\Constraints as Assert;
|
||||
* @category AppData
|
||||
* @package RetailCrm\Component
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category TokenAuthenticator
|
||||
* @package RetailCrm\Component\Authenticator
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -21,7 +21,7 @@ use RetailCrm\Model\Request\BaseRequest;
|
||||
* @category TokenAuthenticator
|
||||
* @package RetailCrm\Component\Authenticator
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category Constants
|
||||
* @package RetailCrm\Component
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -18,7 +18,7 @@ namespace RetailCrm\Component;
|
||||
* @category Constants
|
||||
* @package RetailCrm\Component
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category Container
|
||||
* @package RetailCrm\Component\DependencyInjection
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -30,7 +30,7 @@ use Throwable;
|
||||
* @package RetailCrm\Component\DependencyInjection
|
||||
* @author Evgeniy Zyubin <mail@devanych.ru>
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
@ -190,17 +190,22 @@ final class Container implements ContainerInterface
|
||||
* @param ReflectionClass $reflection
|
||||
* @return object
|
||||
* @throws ContainerException If unable to create object.
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
||||
*/
|
||||
private function getObjectFromReflection(ReflectionClass $reflection): object
|
||||
{
|
||||
if (($constructor = $reflection->getConstructor()) === null) {
|
||||
$constructor = $reflection->getConstructor();
|
||||
|
||||
if (null === $constructor) {
|
||||
return $reflection->newInstance();
|
||||
}
|
||||
|
||||
$arguments = [];
|
||||
|
||||
foreach ($constructor->getParameters() as $parameter) {
|
||||
if ($type = $parameter->getType()) {
|
||||
$type = $parameter->getType();
|
||||
|
||||
if ($type) {
|
||||
$typeName = $type->getName();
|
||||
|
||||
if (!$type->isBuiltin() && ($this->has($typeName) || self::isClassName($typeName))) {
|
||||
@ -218,7 +223,7 @@ final class Container implements ContainerInterface
|
||||
try {
|
||||
$arguments[] = $parameter->getDefaultValue();
|
||||
continue;
|
||||
} catch (ReflectionException $e) {
|
||||
} catch (ReflectionException $exception) {
|
||||
throw new ContainerException(
|
||||
sprintf(
|
||||
'Unable to create object `%s`. Unable to get default value of constructor parameter: `%s`.',
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category ContainerException
|
||||
* @package RetailCrm\Component\DependencyInjection\Exception
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -22,7 +22,7 @@ use LogicException;
|
||||
* @package RetailCrm\Component\DependencyInjection\Exception
|
||||
* @author Evgeniy Zyubin <mail@devanych.ru>
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category NotFoundException
|
||||
* @package RetailCrm\Component\DependencyInjection\Exception
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -22,7 +22,7 @@ use InvalidArgumentException;
|
||||
* @package RetailCrm\Component\DependencyInjection\Exception
|
||||
* @author Evgeniy Zyubin <mail@devanych.ru>
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category FactoryInterface
|
||||
* @package RetailCrm\Component\DependencyInjection
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -21,7 +21,7 @@ use Psr\Container\ContainerInterface;
|
||||
* @package RetailCrm\Component\DependencyInjection
|
||||
* @author Evgeniy Zyubin <mail@devanych.ru>
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category Environment
|
||||
* @package RetailCrm\Component
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -18,7 +18,7 @@ namespace RetailCrm\Component;
|
||||
* @category Environment
|
||||
* @package RetailCrm\Component
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category FactoryException
|
||||
* @package RetailCrm\Component\Exception
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -18,7 +18,7 @@ namespace RetailCrm\Component\Exception;
|
||||
* @category FactoryException
|
||||
* @package RetailCrm\Component\Exception
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category NotImplementedException
|
||||
* @package RetailCrm\Component\Exception
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -18,7 +18,7 @@ namespace RetailCrm\Component\Exception;
|
||||
* @category NotImplementedException
|
||||
* @package RetailCrm\Component\Exception
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category ValidationException
|
||||
* @package RetailCrm\Component\Exception
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -21,7 +21,7 @@ use Throwable;
|
||||
* @category ValidationException
|
||||
* @package RetailCrm\Component\Exception
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category AbstractLogger
|
||||
* @package RetailCrm\Component\Logger
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -20,7 +20,7 @@ use Psr\Log\AbstractLogger as BaseAbstractLogger;
|
||||
* @category AbstractLogger
|
||||
* @package RetailCrm\Component\Logger
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category FileLogger
|
||||
* @package RetailCrm\Component\Logger
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -18,7 +18,7 @@ namespace RetailCrm\Component\Logger;
|
||||
* @category FileLogger
|
||||
* @package RetailCrm\Component\Logger
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category StdioLogger
|
||||
* @package RetailCrm\Component\Logger
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -18,7 +18,7 @@ namespace RetailCrm\Component\Logger;
|
||||
* @category StdioLogger
|
||||
* @package RetailCrm\Component\Logger
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,13 +6,15 @@
|
||||
* @category AppendStream
|
||||
* @package RetailCrm\Component\Psr7
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
namespace RetailCrm\Component\Psr7;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use Psr\Http\Message\StreamInterface;
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
||||
* Class AppendStream
|
||||
@ -21,7 +23,7 @@ use Psr\Http\Message\StreamInterface;
|
||||
* @package RetailCrm\Component\Psr7
|
||||
* @author Michael Dowling <mtdowling@gmail.com>
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
@ -81,7 +83,7 @@ class AppendStream implements StreamInterface
|
||||
public function addStream(StreamInterface $stream): void
|
||||
{
|
||||
if (!$stream->isReadable()) {
|
||||
throw new \InvalidArgumentException('Each stream must be readable');
|
||||
throw new InvalidArgumentException('Each stream must be readable');
|
||||
}
|
||||
|
||||
// The stream is only seekable if all streams are seekable
|
||||
@ -154,13 +156,13 @@ class AppendStream implements StreamInterface
|
||||
$size = 0;
|
||||
|
||||
foreach ($this->streams as $stream) {
|
||||
$s = $stream->getSize();
|
||||
$streamSize = $stream->getSize();
|
||||
|
||||
if ($s === null) {
|
||||
if ($streamSize === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$size += $s;
|
||||
$size += $streamSize;
|
||||
}
|
||||
|
||||
return $size;
|
||||
@ -193,28 +195,29 @@ class AppendStream implements StreamInterface
|
||||
public function seek($offset, $whence = SEEK_SET): void
|
||||
{
|
||||
if (!$this->seekable) {
|
||||
throw new \RuntimeException('This AppendStream is not seekable');
|
||||
throw new RuntimeException('This AppendStream is not seekable');
|
||||
}
|
||||
|
||||
if ($whence !== SEEK_SET) {
|
||||
throw new \RuntimeException('The AppendStream can only seek with SEEK_SET');
|
||||
throw new RuntimeException('The AppendStream can only seek with SEEK_SET');
|
||||
}
|
||||
|
||||
$this->pos = $this->current = 0;
|
||||
|
||||
// Rewind each stream
|
||||
foreach ($this->streams as $i => $stream) {
|
||||
foreach ($this->streams as $index => $stream) {
|
||||
try {
|
||||
$stream->rewind();
|
||||
} catch (\Exception $e) {
|
||||
throw new \RuntimeException('Unable to seek stream '
|
||||
. $i . ' of the AppendStream', 0, $e);
|
||||
} catch (\Exception $exception) {
|
||||
throw new RuntimeException('Unable to seek stream '
|
||||
. $index . ' of the AppendStream', 0, $exception);
|
||||
}
|
||||
}
|
||||
|
||||
// Seek to the actual position by reading from each stream
|
||||
while ($this->pos < $offset && !$this->eof()) {
|
||||
$result = $this->read(min(8096, $offset - $this->pos));
|
||||
|
||||
if ($result === '') {
|
||||
break;
|
||||
}
|
||||
@ -294,7 +297,7 @@ class AppendStream implements StreamInterface
|
||||
*/
|
||||
public function write($string): int
|
||||
{
|
||||
throw new \RuntimeException('Cannot write to an AppendStream');
|
||||
throw new RuntimeException('Cannot write to an AppendStream');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -6,13 +6,14 @@
|
||||
* @category BufferStream
|
||||
* @package RetailCrm\Component\Psr7
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
namespace RetailCrm\Component\Psr7;
|
||||
|
||||
use Psr\Http\Message\StreamInterface;
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
||||
* Class BufferStream
|
||||
@ -21,7 +22,7 @@ use Psr\Http\Message\StreamInterface;
|
||||
* @package RetailCrm\Component\Psr7
|
||||
* @author Michael Dowling <mtdowling@gmail.com>
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
@ -128,7 +129,7 @@ class BufferStream implements StreamInterface
|
||||
*/
|
||||
public function seek($offset, $whence = SEEK_SET): void
|
||||
{
|
||||
throw new \RuntimeException('Cannot seek a BufferStream');
|
||||
throw new RuntimeException('Cannot seek a BufferStream');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -136,7 +137,7 @@ class BufferStream implements StreamInterface
|
||||
*/
|
||||
public function eof(): bool
|
||||
{
|
||||
return strlen($this->buffer) === 0;
|
||||
return $this->buffer === '';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -144,7 +145,7 @@ class BufferStream implements StreamInterface
|
||||
*/
|
||||
public function tell(): int
|
||||
{
|
||||
throw new \RuntimeException('Cannot determine the position of a BufferStream');
|
||||
throw new RuntimeException('Cannot determine the position of a BufferStream');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -6,13 +6,16 @@
|
||||
* @category MultipartStream
|
||||
* @package RetailCrm\Component\Psr7
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
namespace RetailCrm\Component\Psr7;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use Psr\Http\Message\StreamInterface;
|
||||
use RuntimeException;
|
||||
use UnexpectedValueException;
|
||||
|
||||
/**
|
||||
* Class MultipartStream
|
||||
@ -21,7 +24,7 @@ use Psr\Http\Message\StreamInterface;
|
||||
* @package RetailCrm\Component\Psr7
|
||||
* @author Michael Dowling <mtdowling@gmail.com>
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
@ -68,7 +71,7 @@ class MultipartStream implements StreamInterface
|
||||
return $this->stream;
|
||||
}
|
||||
|
||||
throw new \UnexpectedValueException("$name not found on class");
|
||||
throw new UnexpectedValueException("$name not found on class");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -77,7 +80,7 @@ class MultipartStream implements StreamInterface
|
||||
*/
|
||||
public function __set(string $name, $value)
|
||||
{
|
||||
throw new \RuntimeException('Not implemented');
|
||||
throw new RuntimeException('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -85,7 +88,7 @@ class MultipartStream implements StreamInterface
|
||||
*/
|
||||
public function __isset(string $name)
|
||||
{
|
||||
throw new \RuntimeException('Not implemented');
|
||||
throw new RuntimeException('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -300,7 +303,7 @@ class MultipartStream implements StreamInterface
|
||||
{
|
||||
foreach (['contents', 'name'] as $key) {
|
||||
if (!array_key_exists($key, $element)) {
|
||||
throw new \InvalidArgumentException("A '{$key}' key is required");
|
||||
throw new InvalidArgumentException("A '{$key}' key is required");
|
||||
}
|
||||
}
|
||||
|
||||
@ -352,14 +355,16 @@ class MultipartStream implements StreamInterface
|
||||
// Set a default content-length header if one was no provided
|
||||
$length = $this->getHeader($headers, 'content-length');
|
||||
|
||||
if (!$length && $length = $stream->getSize()) {
|
||||
if (!$length) {
|
||||
$length = $stream->getSize();
|
||||
$headers['Content-Length'] = (string) $length;
|
||||
}
|
||||
|
||||
// Set a default Content-Type if one was not supplied
|
||||
$type = $this->getHeader($headers, 'content-type');
|
||||
|
||||
if (!$type && ($filename === '0' || $filename) && $type = Utils::mimetypeFromFilename($filename)) {
|
||||
if (!$type && ($filename === '0' || $filename)) {
|
||||
$type = Utils::mimetypeFromFilename($filename);
|
||||
$headers['Content-Type'] = $type;
|
||||
}
|
||||
|
||||
|
@ -6,13 +6,14 @@
|
||||
* @category PumpStream
|
||||
* @package RetailCrm\Component\Psr7
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
namespace RetailCrm\Component\Psr7;
|
||||
|
||||
use Psr\Http\Message\StreamInterface;
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
||||
* Class PumpStream
|
||||
@ -21,7 +22,7 @@ use Psr\Http\Message\StreamInterface;
|
||||
* @package RetailCrm\Component\Psr7
|
||||
* @author Michael Dowling <mtdowling@gmail.com>
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
@ -142,7 +143,7 @@ class PumpStream implements StreamInterface
|
||||
*/
|
||||
public function seek($offset, $whence = SEEK_SET): void
|
||||
{
|
||||
throw new \RuntimeException('Cannot seek a PumpStream');
|
||||
throw new RuntimeException('Cannot seek a PumpStream');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -160,7 +161,7 @@ class PumpStream implements StreamInterface
|
||||
*/
|
||||
public function write($string): int
|
||||
{
|
||||
throw new \RuntimeException('Cannot write to a PumpStream');
|
||||
throw new RuntimeException('Cannot write to a PumpStream');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -6,13 +6,15 @@
|
||||
* @category Stream
|
||||
* @package RetailCrm\Component\Psr7
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
namespace RetailCrm\Component\Psr7;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use Psr\Http\Message\StreamInterface;
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
||||
* Class Stream
|
||||
@ -21,9 +23,10 @@ use Psr\Http\Message\StreamInterface;
|
||||
* @package RetailCrm\Component\Psr7
|
||||
* @author Michael Dowling <mtdowling@gmail.com>
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
* @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
|
||||
*/
|
||||
class Stream implements StreamInterface
|
||||
{
|
||||
@ -75,7 +78,7 @@ class Stream implements StreamInterface
|
||||
public function __construct($stream, array $options = [])
|
||||
{
|
||||
if (!is_resource($stream)) {
|
||||
throw new \InvalidArgumentException('Stream must be a resource');
|
||||
throw new InvalidArgumentException('Stream must be a resource');
|
||||
}
|
||||
|
||||
if (isset($options['size'])) {
|
||||
@ -111,12 +114,16 @@ class Stream implements StreamInterface
|
||||
}
|
||||
|
||||
return $this->getContents();
|
||||
} catch (\Throwable $e) {
|
||||
} catch (\Throwable $exception) {
|
||||
if (\PHP_VERSION_ID >= 70400) {
|
||||
throw $e;
|
||||
throw $exception;
|
||||
}
|
||||
|
||||
trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR);
|
||||
trigger_error(sprintf(
|
||||
'%s::__toString exception: %s',
|
||||
self::class, (string) $exception),
|
||||
E_USER_ERROR
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -126,13 +133,13 @@ class Stream implements StreamInterface
|
||||
public function getContents(): string
|
||||
{
|
||||
if (!isset($this->stream)) {
|
||||
throw new \RuntimeException('Stream is detached');
|
||||
throw new RuntimeException('Stream is detached');
|
||||
}
|
||||
|
||||
$contents = stream_get_contents($this->stream);
|
||||
|
||||
if ($contents === false) {
|
||||
throw new \RuntimeException('Unable to read stream contents');
|
||||
throw new RuntimeException('Unable to read stream contents');
|
||||
}
|
||||
|
||||
return $contents;
|
||||
@ -162,8 +169,11 @@ class Stream implements StreamInterface
|
||||
}
|
||||
|
||||
$result = $this->stream;
|
||||
|
||||
unset($this->stream);
|
||||
$this->size = $this->uri = null;
|
||||
|
||||
$this->uri = null;
|
||||
$this->size = null;
|
||||
$this->readable = false;
|
||||
$this->writable = false;
|
||||
$this->seekable = false;
|
||||
@ -228,7 +238,7 @@ class Stream implements StreamInterface
|
||||
public function eof(): bool
|
||||
{
|
||||
if (!isset($this->stream)) {
|
||||
throw new \RuntimeException('Stream is detached');
|
||||
throw new RuntimeException('Stream is detached');
|
||||
}
|
||||
|
||||
return feof($this->stream);
|
||||
@ -240,13 +250,13 @@ class Stream implements StreamInterface
|
||||
public function tell(): int
|
||||
{
|
||||
if (!isset($this->stream)) {
|
||||
throw new \RuntimeException('Stream is detached');
|
||||
throw new RuntimeException('Stream is detached');
|
||||
}
|
||||
|
||||
$result = ftell($this->stream);
|
||||
|
||||
if ($result === false) {
|
||||
throw new \RuntimeException('Unable to determine stream position');
|
||||
throw new RuntimeException('Unable to determine stream position');
|
||||
}
|
||||
|
||||
return $result;
|
||||
@ -269,15 +279,15 @@ class Stream implements StreamInterface
|
||||
$whence = (int) $whence;
|
||||
|
||||
if (!isset($this->stream)) {
|
||||
throw new \RuntimeException('Stream is detached');
|
||||
throw new RuntimeException('Stream is detached');
|
||||
}
|
||||
|
||||
if (!$this->seekable) {
|
||||
throw new \RuntimeException('Stream is not seekable');
|
||||
throw new RuntimeException('Stream is not seekable');
|
||||
}
|
||||
|
||||
if (fseek($this->stream, $offset, $whence) === -1) {
|
||||
throw new \RuntimeException('Unable to seek to stream position '
|
||||
throw new RuntimeException('Unable to seek to stream position '
|
||||
. $offset . ' with whence ' . var_export($whence, true));
|
||||
}
|
||||
}
|
||||
@ -290,15 +300,15 @@ class Stream implements StreamInterface
|
||||
public function read($length): string
|
||||
{
|
||||
if (!isset($this->stream)) {
|
||||
throw new \RuntimeException('Stream is detached');
|
||||
throw new RuntimeException('Stream is detached');
|
||||
}
|
||||
|
||||
if (!$this->readable) {
|
||||
throw new \RuntimeException('Cannot read from non-readable stream');
|
||||
throw new RuntimeException('Cannot read from non-readable stream');
|
||||
}
|
||||
|
||||
if ($length < 0) {
|
||||
throw new \RuntimeException('Length parameter cannot be negative');
|
||||
throw new RuntimeException('Length parameter cannot be negative');
|
||||
}
|
||||
|
||||
if (0 === $length) {
|
||||
@ -308,7 +318,7 @@ class Stream implements StreamInterface
|
||||
$string = fread($this->stream, $length);
|
||||
|
||||
if (false === $string) {
|
||||
throw new \RuntimeException('Unable to read from stream');
|
||||
throw new RuntimeException('Unable to read from stream');
|
||||
}
|
||||
|
||||
return $string;
|
||||
@ -322,11 +332,11 @@ class Stream implements StreamInterface
|
||||
public function write($string): int
|
||||
{
|
||||
if (!isset($this->stream)) {
|
||||
throw new \RuntimeException('Stream is detached');
|
||||
throw new RuntimeException('Stream is detached');
|
||||
}
|
||||
|
||||
if (!$this->writable) {
|
||||
throw new \RuntimeException('Cannot write to a non-writable stream');
|
||||
throw new RuntimeException('Cannot write to a non-writable stream');
|
||||
}
|
||||
|
||||
// We can't know the size after writing anything
|
||||
@ -334,7 +344,7 @@ class Stream implements StreamInterface
|
||||
$result = fwrite($this->stream, $string);
|
||||
|
||||
if ($result === false) {
|
||||
throw new \RuntimeException('Unable to write to stream');
|
||||
throw new RuntimeException('Unable to write to stream');
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
@ -6,13 +6,15 @@
|
||||
* @category Utils
|
||||
* @package RetailCrm\Component\Psr7
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
namespace RetailCrm\Component\Psr7;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use Psr\Http\Message\StreamInterface;
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
||||
* Class Utils
|
||||
@ -21,7 +23,7 @@ use Psr\Http\Message\StreamInterface;
|
||||
* @package RetailCrm\Component\Psr7
|
||||
* @author Michael Dowling <mtdowling@gmail.com>
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
@ -87,7 +89,7 @@ class Utils
|
||||
$ex = null;
|
||||
|
||||
set_error_handler(static function (int $errno, string $errstr) use ($filename, $mode, &$ex): bool {
|
||||
$ex = new \RuntimeException(sprintf(
|
||||
$ex = new RuntimeException(sprintf(
|
||||
'Unable to open %s using mode %s: %s',
|
||||
$filename,
|
||||
$mode,
|
||||
@ -121,6 +123,7 @@ class Utils
|
||||
*
|
||||
* @return \Psr\Http\Message\StreamInterface
|
||||
* @throws \InvalidArgumentException if the $resource arg is not valid.
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
||||
*/
|
||||
public static function streamFor($resource = '', array $options = []): StreamInterface
|
||||
{
|
||||
@ -167,7 +170,7 @@ class Utils
|
||||
return new PumpStream($resource, $options);
|
||||
}
|
||||
|
||||
throw new \InvalidArgumentException('Invalid resource type: ' . gettype($resource));
|
||||
throw new InvalidArgumentException('Invalid resource type: ' . gettype($resource));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -190,10 +193,11 @@ class Utils
|
||||
* @param string $extension
|
||||
*
|
||||
* @return string|null
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
*/
|
||||
public static function mimetypeFromExtension(string $extension): ?string
|
||||
{
|
||||
static $mimetypes = [
|
||||
$mimetypes = [
|
||||
'3gp' => 'video/3gpp',
|
||||
'7z' => 'application/x-7z-compressed',
|
||||
'aac' => 'audio/x-aac',
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category ServiceLocator
|
||||
* @package RetailCrm\Component
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -23,7 +23,7 @@ use RetailCrm\Traits\ContainerAwareTrait;
|
||||
* @category ServiceLocator
|
||||
* @package RetailCrm\Component
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category FileItemFactory
|
||||
* @package RetailCrm\Factory
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -23,7 +23,7 @@ use RetailCrm\Model\FileItem;
|
||||
* @category FileItemFactory
|
||||
* @package RetailCrm\Factory
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category RequestFactory
|
||||
* @package RetailCrm\Factory
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -35,9 +35,10 @@ use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
* @category RequestFactory
|
||||
* @package RetailCrm\Factory
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class RequestFactory implements RequestFactoryInterface
|
||||
{
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category SerializationContextFactory
|
||||
* @package RetailCrm\Factory
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -21,7 +21,7 @@ use JMS\Serializer\SerializationContext;
|
||||
* @category SerializationContextFactory
|
||||
* @package RetailCrm\Factory
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category SerializerFactory
|
||||
* @package RetailCrm\Factory
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -27,7 +27,7 @@ use RetailCrm\Interfaces\FactoryInterface;
|
||||
* @category SerializerFactory
|
||||
* @package RetailCrm\Factory
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category AppDataInterface
|
||||
* @package RetailCrm\Interfaces
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -19,7 +19,7 @@ namespace RetailCrm\Interfaces;
|
||||
* @category AppDataInterface
|
||||
* @package RetailCrm\Interfaces
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category AuthenticatorInterface
|
||||
* @package RetailCrm\Interfaces
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -21,7 +21,7 @@ use RetailCrm\Model\Request\BaseRequest;
|
||||
* @category AuthenticatorInterface
|
||||
* @package RetailCrm\Interfaces
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category BuilderInterface
|
||||
* @package RetailCrm\Interfaces
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -19,7 +19,7 @@ namespace RetailCrm\Interfaces;
|
||||
* @category BuilderInterface
|
||||
* @package RetailCrm\Interfaces
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category ContainerAwareInterface
|
||||
* @package RetailCrm\Interfaces
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -21,7 +21,7 @@ use Psr\Container\ContainerInterface;
|
||||
* @category ContainerAwareInterface
|
||||
* @package RetailCrm\Interfaces
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category FactoryInterface
|
||||
* @package RetailCrm\Interfaces
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -19,7 +19,7 @@ namespace RetailCrm\Interfaces;
|
||||
* @category FactoryInterface
|
||||
* @package RetailCrm\Interfaces
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category FactoryInterface
|
||||
* @package RetailCrm\Interfaces
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -19,7 +19,7 @@ namespace RetailCrm\Interfaces;
|
||||
* @category FileItemFactoryInterface
|
||||
* @package RetailCrm\Interfaces
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category FileItemInterface
|
||||
* @package RetailCrm\Interfaces
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -21,7 +21,7 @@ use Psr\Http\Message\StreamInterface;
|
||||
* @category FileItemInterface
|
||||
* @package RetailCrm\Interfaces
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category RequestDtoInterface
|
||||
* @package RetailCrm\Interfaces
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -19,7 +19,7 @@ namespace RetailCrm\Interfaces;
|
||||
* @category RequestDtoInterface
|
||||
* @package RetailCrm\Interfaces
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category RequestFactoryInterface
|
||||
* @package RetailCrm\Interfaces
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -22,7 +22,7 @@ use RetailCrm\Model\Request\BaseRequest;
|
||||
* @category RequestFactoryInterface
|
||||
* @package RetailCrm\Interfaces
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category RequestSignerInterface
|
||||
* @package RetailCrm\Interfaces
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -21,7 +21,7 @@ use RetailCrm\Model\Request\BaseRequest;
|
||||
* @category RequestSignerInterface
|
||||
* @package RetailCrm\Interfaces
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category RequestTimestampProviderInterface
|
||||
* @package RetailCrm\Interfaces
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -21,7 +21,7 @@ use RetailCrm\Model\Request\BaseRequest;
|
||||
* @category RequestTimestampProviderInterface
|
||||
* @package RetailCrm\Interfaces
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category FileItem
|
||||
* @package RetailCrm\Model
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -21,7 +21,7 @@ use RetailCrm\Interfaces\FileItemInterface;
|
||||
* @category FileItem
|
||||
* @package RetailCrm\Model
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category BaseRequest
|
||||
* @package RetailCrm\Model\Request
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -22,7 +22,7 @@ use Symfony\Component\Validator\Constraints as Assert;
|
||||
* @category BaseRequest
|
||||
* @package RetailCrm\Model\Request
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category HttpDnsGetRequest
|
||||
* @package RetailCrm\Model\Request
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -18,7 +18,7 @@ namespace RetailCrm\Model\Request;
|
||||
* @category HttpDnsGetRequest
|
||||
* @package RetailCrm\Model\Request
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category RequestDataFilter
|
||||
* @package RetailCrm\Service
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -20,7 +20,7 @@ use RetailCrm\Interfaces\FileItemInterface;
|
||||
* @category RequestDataFilter
|
||||
* @package RetailCrm\Service
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category RequestSigner
|
||||
* @package RetailCrm\Service
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -25,7 +25,7 @@ use RetailCrm\Model\Request\BaseRequest;
|
||||
* @category RequestSigner
|
||||
* @package RetailCrm\Service
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category TimestampProvider
|
||||
* @package RetailCrm\Service
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -23,7 +23,7 @@ use RetailCrm\Model\Request\BaseRequest;
|
||||
* @category TimestampProvider
|
||||
* @package RetailCrm\Service
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
@ -49,7 +49,7 @@ class RequestTimestampProvider implements RequestTimestampProviderInterface
|
||||
if (function_exists('date_default_timezone_set')
|
||||
&& function_exists('date_default_timezone_get')
|
||||
) {
|
||||
date_default_timezone_set(@date_default_timezone_get());
|
||||
date_default_timezone_set(date_default_timezone_get());
|
||||
}
|
||||
|
||||
$timestamp = new DateTime();
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category Client
|
||||
* @package RetailCrm\TopClient
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -28,7 +28,7 @@ use Symfony\Component\Validator\Constraints as Assert;
|
||||
* @category Client
|
||||
* @package RetailCrm\TopClient
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
@ -142,12 +142,13 @@ class Client
|
||||
* @throws \Psr\Http\Client\ClientExceptionInterface
|
||||
* @throws \RetailCrm\Component\Exception\ValidationException
|
||||
* @throws \RetailCrm\Component\Exception\FactoryException
|
||||
*
|
||||
* @todo Implement this method and remove tag below.
|
||||
* @SuppressWarnings(PHPMD)
|
||||
*/
|
||||
public function sendRequest(BaseRequest $request)
|
||||
{
|
||||
$httpRequest = $this->requestFactory->fromModel($request, $this->appData, $this->authenticator);
|
||||
$response = $this->httpClient->sendRequest($httpRequest);
|
||||
|
||||
// TODO: Implement this
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category ContainerAwareTrait
|
||||
* @package RetailCrm\Traits
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -22,7 +22,7 @@ use Symfony\Component\Validator\Constraints as Assert;
|
||||
* @category ContainerAwareTrait
|
||||
* @package RetailCrm\Traits
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @category ValidatorAwareTrait
|
||||
* @package RetailCrm\Traits
|
||||
* @author RetailCRM <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see http://help.retailcrm.ru
|
||||
*/
|
||||
@ -23,7 +23,7 @@ use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
* @category ValidatorAwareTrait
|
||||
* @package RetailCrm\Traits
|
||||
* @author RetailDriver LLC <integration@retailcrm.ru>
|
||||
* @license MIT
|
||||
* @license MIT https://mit-license.org
|
||||
* @link http://retailcrm.ru
|
||||
* @see https://help.retailcrm.ru
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user