1
0
mirror of synced 2024-11-21 19:36:02 +03:00

Update php version (#20)

This commit is contained in:
tishmaria90 2021-12-13 10:48:18 +03:00 committed by GitHub
parent c6a44ea2b3
commit 98563e2e60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 3839 additions and 1559 deletions

View File

@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['7.1', '7.2', '7.3']
php-version: ['7.2', '7.3', '7.4', '8.0']
steps:
- uses: actions/checkout@v2
- name: Setup PHP ${{ matrix.php-version }}

View File

@ -12,21 +12,22 @@
}
],
"require": {
"php": ">=7.1",
"php": ">=7.2.5",
"ext-curl": "*",
"ext-json": "*",
"jms/serializer": "1.14.*",
"symfony/validator": "4.3.*",
"doctrine/annotations": "1.12.*",
"jms/serializer": "3.*",
"symfony/validator": "5.4.*",
"doctrine/annotations": "1.13.*",
"doctrine/cache": "1.11.*",
"guzzlehttp/guzzle": "6.*"
"guzzlehttp/guzzle": "6.*",
"symfony/intl": "^5.4"
},
"require-dev": {
"phpmd/phpmd": "2.*",
"squizlabs/php_codesniffer": "3.4.*",
"symfony/dotenv": "4.3.*",
"phpunit/phpunit": "7.*",
"phpstan/phpstan": "0.11.*"
"symfony/dotenv": "5.4.*",
"phpunit/phpunit": "8.5.*",
"phpstan/phpstan": "0.12.*"
},
"support": {
"email": "support@retailcrm.pro"

3408
composer.lock generated

File diff suppressed because it is too large Load Diff

1917
phpstan-baseline.neon Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,7 @@
includes:
- phpstan-baseline.neon
parameters:
autoload_files:
- %currentWorkingDirectory%/vendor/autoload.php
level: 7
paths:
- %currentWorkingDirectory%/src

View File

@ -232,7 +232,7 @@ class HttpClient
$message = '';
foreach ($errors as $error) {
$message .= (string)$error;
$message .= $error->getMessage();
}
throw new InvalidArgumentException($message);

View File

@ -233,7 +233,7 @@ class Channel implements ModelInterface
/**
* @param string $name
*/
public function setName(string $name)
public function setName($name)
{
$this->name = $name;
}

View File

@ -40,14 +40,16 @@ class Serializer
$serializer = SerializerBuilder::create()->build();
$context = self::getContext(false);
switch ($serialize) {
case self::S_ARRAY:
$serialized = $serializer->toArray($request, $context);
break;
case self::S_JSON:
default:
$serialized = $serializer->serialize($request, $serialize, $context);
break;
if ($context instanceof SerializationContext) {
switch ($serialize) {
case self::S_ARRAY:
$serialized = $serializer->toArray($request, $context);
break;
case self::S_JSON:
default:
$serialized = $serializer->serialize($request, $serialize, $context);
break;
}
}
return $serialized;
@ -68,15 +70,17 @@ class Serializer
$serializer = SerializerBuilder::create()->build();
$context = self::getContext(true);
switch ($from) {
case self::S_ARRAY:
$deserialized = $serializer
->fromArray(array_filter($data), self::normalizeNamespace($entityType), $context);
break;
case self::S_JSON:
$deserialized = $serializer
->deserialize($data, self::normalizeNamespace($entityType), $from, $context);
break;
if ($context instanceof DeserializationContext) {
switch ($from) {
case self::S_ARRAY:
$deserialized = $serializer
->fromArray(array_filter($data), self::normalizeNamespace($entityType), $context);
break;
case self::S_JSON:
$deserialized = $serializer
->deserialize($data, self::normalizeNamespace($entityType), $from, $context);
break;
}
}
return $deserialized instanceof ModelInterface ? $deserialized : new ErrorOnlyResponse();
@ -93,9 +97,9 @@ class Serializer
$context = new DeserializationContext();
} else {
$context = new SerializationContext();
}
$context->setSerializeNull(false);
$context->setSerializeNull(false);
}
return $context;
}
@ -103,7 +107,7 @@ class Serializer
/**
* @param string $namespace
*
* @return bool|string
* @return string
*/
private static function normalizeNamespace(string $namespace)
{

View File

@ -14,6 +14,7 @@ use Symfony\Component\Dotenv\Dotenv;
$dotenv = new Dotenv();
try {
$dotenv->usePutenv(true);
$dotenv->load(__DIR__ . '/../.env');
} catch (Exception $exception) {
echo "WARNING: Can't load .env file. Using default environment.";