Sunnysideup\Moodle\Api\MoodleWebservice::connect
asks Moodle for token. If it fails it will return a null object. You can see errors by looking at MoodleWebservice::getErrors().
Alternatively you can set one in moodle.yml, it will still return an instance.
Signature
public function connect()
Returns
- null|MoodleWebservice