Skip to content

Commit

Permalink
Merge pull request #562 from TysonAndre/document-hhvm-unsupported
Browse files Browse the repository at this point in the history
Remove workarounds for unsupported HHVM
  • Loading branch information
stof authored Aug 24, 2022
2 parents 36905c7 + c1a2c71 commit a4477cd
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 121 deletions.
34 changes: 0 additions & 34 deletions spec/Prophecy/Doubler/ClassPatch/HhvmExceptionPatchSpec.php

This file was deleted.

63 changes: 0 additions & 63 deletions src/Prophecy/Doubler/ClassPatch/HhvmExceptionPatch.php

This file was deleted.

1 change: 0 additions & 1 deletion src/Prophecy/Prophet.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public function __construct(
$doubler->registerClassPatch(new ClassPatch\DisableConstructorPatch);
$doubler->registerClassPatch(new ClassPatch\ProphecySubjectPatch);
$doubler->registerClassPatch(new ClassPatch\ReflectionClassNewInstancePatch);
$doubler->registerClassPatch(new ClassPatch\HhvmExceptionPatch());
$doubler->registerClassPatch(new ClassPatch\MagicCallPatch);
$doubler->registerClassPatch(new ClassPatch\KeywordPatch);
}
Expand Down
12 changes: 0 additions & 12 deletions src/Prophecy/Util/ExportUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,6 @@ public static function toArray($value)
// above (fast) mechanism nor with reflection in Zend.
// Format the output similarly to print_r() in this case
if ($value instanceof \SplObjectStorage) {
// However, the fast method does work in HHVM, and exposes the
// internal implementation. Hide it again.
if (property_exists('\SplObjectStorage', '__storage')) {
unset($array['__storage']);
} elseif (property_exists('\SplObjectStorage', 'storage')) {
unset($array['storage']);
}

if (property_exists('\SplObjectStorage', '__key')) {
unset($array['__key']);
}

foreach ($value as $key => $val) {
// Use the same identifier that would be printed alongside the object's representation elsewhere.
$array[spl_object_id($val)] = array(
Expand Down
12 changes: 1 addition & 11 deletions tests/Doubler/Generator/ClassMirrorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ public function it_properly_reads_methods_arguments_with_types()

/**
* @test
* @requires PHP 5.4
*/
public function it_properly_reads_methods_arguments_with_callable_types()
{
Expand Down Expand Up @@ -153,7 +152,6 @@ public function it_properly_reads_methods_arguments_with_callable_types()

/**
* @test
* @requires PHP 5.6
*/
public function it_properly_reads_methods_variadic_arguments()
{
Expand All @@ -176,14 +174,9 @@ public function it_properly_reads_methods_variadic_arguments()

/**
* @test
* @requires PHP 5.6
*/
public function it_properly_reads_methods_typehinted_variadic_arguments()
{
if (defined('HHVM_VERSION_ID')) {
$this->markTestSkipped('HHVM does not support typehints on variadic arguments.');
}

$class = new \ReflectionClass('Fixtures\Prophecy\WithTypehintedVariadicArgument');

$mirror = new ClassMirror();
Expand Down Expand Up @@ -337,7 +330,6 @@ public function it_does_not_throw_exception_for_virtually_private_finals()

/**
* @test
* @requires PHP 7
*/
public function it_reflects_return_typehints()
{
Expand Down Expand Up @@ -418,7 +410,6 @@ public function it_doesnt_fail_to_typehint_nonexistent_FQCN()

/**
* @test
* @requires PHP 7.1
*/
public function it_doesnt_fail_on_array_nullable_parameter_with_not_null_default_value()
{
Expand All @@ -445,7 +436,6 @@ public function it_doesnt_fail_to_typehint_nonexistent_RQCN()

/**
* @test
* @requires PHP 7.2
*/
function it_doesnt_fail_when_method_is_extended_with_more_params()
{
Expand Down Expand Up @@ -614,7 +604,7 @@ public function it_can_not_double_an_enum()
}

$this->expectException(ClassMirrorException::class);

$classNode = (new ClassMirror())->reflect(new \ReflectionClass('Fixtures\Prophecy\Enum'), []);
}

Expand Down

0 comments on commit a4477cd

Please sign in to comment.