Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
opt
/
psa
/
admin
/
plib
/
modules
/
rest-api
/
vendor
/
jms
/
serializer
/
src
/
File Content:
AbstractVisitor.php
<?php declare (strict_types=1); namespace PleskRestApi\JMS\Serializer; use PleskRestApi\JMS\Serializer\Exception\NonFloatCastableTypeException; use PleskRestApi\JMS\Serializer\Exception\NonIntCastableTypeException; use PleskRestApi\JMS\Serializer\Exception\NonStringCastableTypeException; /** * @internal */ abstract class AbstractVisitor implements VisitorInterface { /** * @var GraphNavigatorInterface */ protected $navigator; public function setNavigator(GraphNavigatorInterface $navigator) : void { $this->navigator = $navigator; } /** * {@inheritdoc} */ public function prepare($data) { return $data; } protected function getElementType(array $typeArray) : ?array { if (\false === isset($typeArray['params'][0])) { return null; } if (isset($typeArray['params'][1]) && \is_array($typeArray['params'][1])) { return $typeArray['params'][1]; } else { return $typeArray['params'][0]; } } /** * logic according to strval https://www.php.net/manual/en/function.strval.php * "You cannot use strval() on arrays or on objects that do not implement the __toString() method." * * @param mixed $value */ protected function assertValueCanBeCastToString($value) : void { if (\is_array($value)) { throw new NonStringCastableTypeException($value); } if (\is_object($value) && !\method_exists($value, '__toString')) { throw new NonStringCastableTypeException($value); } } /** * logic according to intval https://www.php.net/manual/en/function.intval.php * "intval() should not be used on objects, as doing so will emit an E_NOTICE level error and return 1." * * @param mixed $value */ protected function assertValueCanBeCastToInt($value) : void { if (\is_object($value) && !$value instanceof \SimpleXMLElement) { throw new NonIntCastableTypeException($value); } } /** * logic according to floatval https://www.php.net/manual/en/function.floatval.php * "floatval() should not be used on objects, as doing so will emit an E_NOTICE level error and return 1." * * @param mixed $value */ protected function assertValueCanCastToFloat($value) : void { if (\is_object($value) && !$value instanceof \SimpleXMLElement) { throw new NonFloatCastableTypeException($value); } } protected function mapRoundMode(?string $roundMode = null) : int { switch ($roundMode) { case 'HALF_DOWN': $roundMode = \PHP_ROUND_HALF_DOWN; break; case 'HALF_EVEN': $roundMode = \PHP_ROUND_HALF_EVEN; break; case 'HALF_ODD': $roundMode = \PHP_ROUND_HALF_ODD; break; case 'HALF_UP': default: $roundMode = \PHP_ROUND_HALF_UP; } return $roundMode; } }
Edit
Rename
Chmod
Delete
FILE
FOLDER
INFO
Name
Size
Permission
Action
Accessor
---
0755
Annotation
---
0755
Builder
---
0755
Construction
---
0755
ContextFactory
---
0755
EventDispatcher
---
0755
Exception
---
0755
Exclusion
---
0755
Expression
---
0755
GraphNavigator
---
0755
Handler
---
0755
Metadata
---
0755
Naming
---
0755
Ordering
---
0755
Twig
---
0755
Type
---
0755
Visitor
---
0755
AbstractVisitor.php
3109 bytes
0644
ArrayTransformerInterface.php
930 bytes
0644
Context.php
6343 bytes
0644
DeserializationContext.php
799 bytes
0644
Functions.php
428 bytes
0644
GraphNavigator.php
1101 bytes
0644
GraphNavigatorInterface.php
1042 bytes
0644
JsonDeserializationStrictVisitor.php
4126 bytes
0644
JsonDeserializationVisitor.php
6654 bytes
0644
JsonSerializationVisitor.php
5223 bytes
0644
NullAwareVisitorInterface.php
360 bytes
0644
SerializationContext.php
3502 bytes
0644
Serializer.php
8806 bytes
0644
SerializerBuilder.php
21683 bytes
0644
SerializerInterface.php
793 bytes
0644
VisitorInterface.php
950 bytes
0644
XmlDeserializationVisitor.php
16239 bytes
0644
XmlSerializationVisitor.php
16831 bytes
0644
N4ST4R_ID | Naxtarrr