Skip to content

Commit

Permalink
Enable PHP 7.2 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
koriym committed Sep 17, 2023
1 parent 471bd83 commit 85f36ee
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/AopCodeGenMethodSignature.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ public function getTypeString(?ReflectionType $type): string

// 単一型の Nullableのチェックをユニオンタイプのチェックの後に移動
if ($type && $type->allowsNull()) {
$typeStr = 'null|' . $typeStr;
if (PHP_VERSION_ID >= 80000) {
$typeStr = 'null|' . $typeStr;
} else {
$typeStr = '?' . $typeStr;
}
}

return $typeStr;
Expand Down
35 changes: 35 additions & 0 deletions tests/tmp_unerase/Ray_Aop_FakeWeaverMock_2665014008.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

declare(strict_types=1);

namespace Ray\Aop;

/** doc comment of FakeMock */
class FakeWeaverMock_2665014008 extends FakeWeaverMock implements \Ray\Aop\WeavedInterface{
use \Ray\Aop\InterceptTrait;
/**
* doc comment of returnSame
*/
public function returnSame($a)
{
return $this->_intercept(func_get_args(), __FUNCTION__);
}

/**
* doc comment of getSub
*/
public function getSub($a, $b)
{
return $this->_intercept(func_get_args(), __FUNCTION__);
}

public function returnValue(?\Ray\Aop\FakeNum $num = NULL)
{
return $this->_intercept(func_get_args(), __FUNCTION__);
}

public function getPrivateVal()
{
return $this->_intercept(func_get_args(), __FUNCTION__);
}
}

0 comments on commit 85f36ee

Please sign in to comment.