Merge branch 'develop'

This commit is contained in:
Vincent BRIDIER 2024-10-15 14:17:17 +02:00
commit f9dc59ff15
No known key found for this signature in database
GPG key ID: 8571BFA20420D512
9 changed files with 10 additions and 5 deletions

View file

@ -3,7 +3,7 @@
"type": "library",
"description": "LDC CRM Client V4",
"license": "MIT",
"version": "4.0.4",
"version": "4.0.5",
"authors": [
{
"name": "Jérémy Munsch",

View file

@ -125,6 +125,7 @@ class Answer extends ClientModel
*
* @return array
*/
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return [

View file

@ -391,6 +391,7 @@ class ArcadiaMailDefault extends ClientModel
*
* @return array
*/
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return [

View file

@ -334,6 +334,7 @@ class ArcadiaMailGame extends ClientModel
*
* @return array
*/
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return [

View file

@ -355,7 +355,7 @@ class Customer extends ClientModel
try {
$properties['country'] = (\is_object($properties['country']) and
get_class($properties['country']) === Country::class) ?
$properties['country']->value : (ctype_digit($properties['country']) ?
$properties['country']->value : (is_numeric(trim($properties['country'])) ?
(int)$properties['country'] : $properties['country']);
} catch (TypeError | \BadMethodCallException $e) {
// * Cast anyway
@ -614,6 +614,7 @@ class Customer extends ClientModel
*
* @return array
*/
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return [

View file

@ -298,6 +298,7 @@ class Question extends ClientModel
*
* @return array
*/
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return [

View file

@ -124,7 +124,7 @@ trait BaseEnum
* Fetch enum using value.
*
* @param \LDC\LDCCRM\Traits\BaseEnum|integer|string $value
* @param string $field
* @param string $field
* @return \LDC\LDCCRM\Traits\BaseEnum|null
*/
public static function make(self|int|string $value, string $field = 'value'): self|null

View file

@ -9,7 +9,6 @@ use LDC\LDCCRM\Exceptions\SkipValidationException;
use LDC\LDCCRM\Exceptions\ValidationException;
use LDC\LDCCRM\Transport\Request;
use Respect\Validation\Validator;
use Illuminate\Support\Str;
/**
* This is the LDCCRM utility class
@ -600,7 +599,7 @@ class Utils
$route['uri'] = sprintf('%s?%s', $route['uri'], \http_build_query($query));
}
return new Request(
HttpMethods::make(Str::lower($route['methods'][0]), 'name'),
HttpMethods::make(strtolower($route['methods'][0]), 'name'),
$route['uri'],
[],
$data

View file

@ -187,6 +187,7 @@ class WPCrmUser implements JsonSerializable
*
* @return array
*/
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return [