venveo / craft-oauthclient

A free to use OAuth 2.0 Client helper for Craft 3 developers
MIT License
9 stars 3 forks source link

Typos in code in README #36

Open bencresty opened 3 years ago

bencresty commented 3 years ago

Fyi: There are some typos in the example code in the README on how to register a custom provider;

The line $event->types[] = MyProvider:class is missing both a colon and a semicolon and throws an error when using it like this. When using this here it needed to be changed into

$event->types[] = MyProvider::class;

I don't know if there are other ways of making these publicly available, but in my case, in order to make it work, I had to add the Event use too, which isn't in the example:

use yii\base\Event;
// ...

I also needed to add namespaces to reach the custom provider, but not sure if that's really required as I'm not a full time php developer and focussed on front end.

Hope this helps.