Aggiornato Composer
This commit is contained in:
@@ -36,6 +36,7 @@ trait TypeTrait
|
||||
* @param string $type The type to check the value against.
|
||||
* @param mixed $value The value to check.
|
||||
*/
|
||||
// phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
|
||||
protected function checkType(string $type, $value): bool
|
||||
{
|
||||
switch ($type) {
|
||||
|
||||
@@ -17,6 +17,7 @@ namespace Ramsey\Collection\Tool;
|
||||
use Ramsey\Collection\Exception\ValueExtractionException;
|
||||
|
||||
use function get_class;
|
||||
use function is_object;
|
||||
use function method_exists;
|
||||
use function property_exists;
|
||||
use function sprintf;
|
||||
@@ -37,6 +38,7 @@ trait ValueExtractorTrait
|
||||
*
|
||||
* @throws ValueExtractionException if the method or property is not defined.
|
||||
*/
|
||||
// phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
|
||||
protected function extractValue($object, string $propertyOrMethod)
|
||||
{
|
||||
if (!is_object($object)) {
|
||||
@@ -52,7 +54,8 @@ trait ValueExtractorTrait
|
||||
}
|
||||
|
||||
throw new ValueExtractionException(
|
||||
sprintf('Method or property "%s" not defined in %s', $propertyOrMethod, get_class($object))
|
||||
// phpcs:ignore SlevomatCodingStandard.Classes.ModernClassNameReference.ClassNameReferencedViaFunctionCall
|
||||
sprintf('Method or property "%s" not defined in %s', $propertyOrMethod, get_class($object)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,8 +21,10 @@ use function get_resource_type;
|
||||
use function is_array;
|
||||
use function is_bool;
|
||||
use function is_callable;
|
||||
use function is_object;
|
||||
use function is_resource;
|
||||
use function is_scalar;
|
||||
use function var_export;
|
||||
|
||||
/**
|
||||
* Provides functionality to express a value as string
|
||||
@@ -44,6 +46,7 @@ trait ValueToStringTrait
|
||||
*
|
||||
* @param mixed $value the value to return as a string.
|
||||
*/
|
||||
// phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
|
||||
protected function toolValueToString($value): string
|
||||
{
|
||||
// null
|
||||
@@ -89,6 +92,7 @@ trait ValueToStringTrait
|
||||
}
|
||||
|
||||
// unknown type
|
||||
// phpcs:ignore SlevomatCodingStandard.Classes.ModernClassNameReference.ClassNameReferencedViaFunctionCall
|
||||
return '(' . get_class($value) . ' Object)';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user