Skip to content

Commit

Permalink
Use native compiler optimized functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Toflar committed Feb 18, 2021
1 parent 356ea5b commit 9bc8e63
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Serializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public function normalize($data, $format = null, array $context = [])
{
$normalizedData = parent::normalize($data, $format, $context);

if (is_object($data)) {
$typeData = [self::KEY_TYPE => get_class($data)];
if (\is_object($data)) {
$typeData = [self::KEY_TYPE => \get_class($data)];
$valueData = is_scalar($normalizedData) ? [self::KEY_SCALAR => $normalizedData] : $normalizedData;
$normalizedData = array_merge($typeData, $valueData);
}
Expand All @@ -31,7 +31,7 @@ public function normalize($data, $format = null, array $context = [])

public function denormalize($data, $class, $format = null, array $context = [])
{
if (is_array($data) && (isset($data[self::KEY_TYPE]))) {
if (\is_array($data) && (isset($data[self::KEY_TYPE]))) {
$type = $data[self::KEY_TYPE];
unset($data[self::KEY_TYPE]);

Expand Down

0 comments on commit 9bc8e63

Please sign in to comment.