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

'\self' is an invalid class name #15

Closed
tpapic opened this issue Apr 2, 2019 · 3 comments
Closed

'\self' is an invalid class name #15

tpapic opened this issue Apr 2, 2019 · 3 comments
Labels

Comments

@tpapic
Copy link

tpapic commented Apr 2, 2019

I was following your init tutorial with logging but I always get this error.

'\self' is an invalid class name {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalErrorException(code: 64): '\\self' is an invalid class name at npp/project/api/storage/app/aspect/_proxies/app/User.php/App/User.php:1055)
Method which has this error

/**
     * Create a new pivot model instance.
     *
     * @param  \Illuminate\Database\Eloquent\Model  $parent
     * @param  array  $attributes
     * @param  string  $table
     * @param  bool  $exists
     * @param  string|null  $using
     * @return \Illuminate\Database\Eloquent\Relations\Pivot
     */
    public function newPivot(\self $parent, array $attributes, $table, $exists, $using = NULL)
    {
        return self::$__joinPoints['method:newPivot']->__invoke($this, \array_slice([$parent, $attributes, $table, $exists, $using], 0, \func_num_args()));
    }

PHP-version: 7.1.23
Laravel version: 5.5

@SerafimArts
Copy link
Member

SerafimArts commented Apr 2, 2019

@tpapic can you please rediscover this issue here https://github.com/goaop/framework/issues ? This issue applies to any code where typehint self is used.

@lisachenko a brief example that reproduces the error:

class Example
{
    public function example(self $arg): self
    {
        return $arg;
    }
}

Aspect:

@Before("execution(public Example->example(*))")

@SerafimArts
Copy link
Member

I close this issue in order not to duplicate it.

@lisachenko
Copy link
Member

Please, update goaop/framework to >=2.3.0 to have this issue fixed.

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

No branches or pull requests

3 participants