web-token / jwt-doc

Documentation for the JWT Framework
MIT License
12 stars 19 forks source link

Sign method undefiend #26

Closed Mihai-github closed 3 years ago

Mihai-github commented 4 years ago

Hi, I have a problem with "The easy way". The problem is my code editor says that the sign method is undefiend and i cant figure out a method to make it work..

Spomky commented 4 years ago

Hi @Mihai-github,

This is because at some point the method you called return an AbstractBuilder due to the limitation of the self return statement.

You can safely assume it is a JWSBuilder object that provides the sign method. This should be fixed with PHP8 and the static return type or the $this annotation