Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

タイプヒンティングが:voidのメソッドをinterceptできない #4

Open
wand2016 opened this issue Jul 25, 2019 · 4 comments

Comments

@wand2016
Copy link
Owner

No description provided.

@wand2016 wand2016 changed the title タイプヒンティングで:voidのメソッドをinterceptできない タイプヒンティングが:voidのメソッドをinterceptできない Jul 25, 2019
@wand2016
Copy link
Owner Author

再現方法??

@wand2016
Copy link
Owner Author

storage/Tests_Feature_Sample_LayerSupertype_DomainModel_NIB1NwE.php

<?php

declare (strict_types=1);
namespace Tests\Feature\Sample\LayerSupertype;

use Ray\Aop\WeavedInterface;
use Ray\Aop\ReflectiveMethodInvocation as Invocation;
use WandTa\Annotations\VisibleTo;
class DomainModel_NIB1NwE extends \Tests\Feature\Sample\LayerSupertype\DomainModel implements WeavedInterface
{
    public $bind;
    public $bindings = [];
    public $methodAnnotations = 'a:1:{s:13:"someOperation";a:1:{i:0;O:28:"WandTa\\Annotations\\VisibleTo":1:{s:39:"\0WandTa\\Annotations\\VisibleTo\0className";s:47:"Tests\\Feature\\Sample\\LayerSupertype\\ServiceBase";}}}';
    public $classAnnotations = 'a:0:{}';
    private $isAspect = true;
    /**
     * @VisibleTo("Tests\Feature\Sample\LayerSupertype\ServiceBase")
     */
    public function someOperation() : void
    {
        if (!$this->isAspect) {
            $this->isAspect = true;
            return call_user_func_array([$this, 'parent::' . __FUNCTION__], func_get_args());
        }
        $this->isAspect = false;
        $result = (new Invocation($this, __FUNCTION__, func_get_args(), $this->bindings[__FUNCTION__]))->proceed();
        $this->isAspect = true;
        return $result;
    }
}

@wand2016
Copy link
Owner Author

return $result; これ

@wand2016
Copy link
Owner Author

本家側修正につき
composer.jsonに修正必要

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant