Skip to content

Commit

Permalink
Dropping HHVM support
Browse files Browse the repository at this point in the history
  • Loading branch information
nilportugues committed Feb 10, 2017
1 parent f55a6c7 commit 57464fa
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 50 deletions.
6 changes: 1 addition & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@ language: php
php:
- "5.6"
- "7.0"
- "hhvm"
- "7.1"

before_script:
- composer install


script:
- bin/phpunit --coverage-text

matrix:
allow_failures:
- php: "hhvm"
branches:
only:
- master
Expand Down
7 changes: 0 additions & 7 deletions src/Mapping/serialization_hhvm.php

This file was deleted.

8 changes: 0 additions & 8 deletions src/Mapping/unserialization_hhvm.php

This file was deleted.

31 changes: 1 addition & 30 deletions src/Serializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@ class Serializer
'string' => 'serializeScalar',
];

/**
* @var bool
*/
protected $isHHVM;

/**
* Hack specific serialization classes.
*
Expand All @@ -79,16 +74,7 @@ class Serializer
*/
public function __construct(StrategyInterface $strategy)
{
$this->isHHVM = \defined('HHVM_VERSION');
if ($this->isHHVM) {
// @codeCoverageIgnoreStart
$this->serializationMap = \array_merge(
$this->serializationMap,
include \realpath(\dirname(__FILE__).'/Mapping/serialization_hhvm.php')
);
$this->unserializationMapHHVM = include \realpath(\dirname(__FILE__).'/Mapping/unserialization_hhvm.php');
// @codeCoverageIgnoreEnd
}

$this->serializationStrategy = $strategy;
}

Expand Down Expand Up @@ -142,12 +128,6 @@ protected function serializeData($value)
{
$this->guardForUnsupportedValues($value);

if ($this->isHHVM && ($value instanceof \DateTimeZone || $value instanceof \DateInterval)) {
// @codeCoverageIgnoreStart
return \call_user_func_array($this->serializationMap[get_class($value)], [$this, $value]);
// @codeCoverageIgnoreEnd
}

if ($this->isInstanceOf($value, 'SplFixedArray')) {
return SplFixedArraySerializer::serialize($this, $value);
}
Expand Down Expand Up @@ -313,15 +293,6 @@ protected function unserializeDateTimeFamilyObject(array $value, $className)
$obj = null;

if ($this->isDateTimeFamilyObject($className)) {
if ($this->isHHVM) {
// @codeCoverageIgnoreStart
return \call_user_func_array(
$this->unserializationMapHHVM[$className],
[$this, $className, $value]
);
// @codeCoverageIgnoreEnd
}

$obj = $this->restoreUsingUnserialize($className, $value);
self::$objectMapping[self::$objectMappingIndex++] = $obj;
}
Expand Down

0 comments on commit 57464fa

Please sign in to comment.