Skip to content

Setting Options using $nylas->Options fails with 'class Nylas\Options\Abs not found!' exception #45

@MatthewLoffredo

Description

@MatthewLoffredo

Current Behavior:

When attempting to set the access token as shown in the docs:

$nylas->Options->setAccessToken("pass the token you got");

the following exception is thrown:

[2022-03-07 22:39:17] local.DEBUG: Nylas\Exceptions\NylasException: class Nylas\Utilities\Abs not found! in /var/www/vendor/lanlin/nylas-php/src/Client.php:103
Stack trace:
#0 /var/www/vendor/lanlin/nylas-php/src/Client.php(79): Nylas\Client->callSubClass()
#1 /var/www/app/Services/NylasService.php(80): Nylas\Client->__get()
...

Expected Behavior:

The access token should be set.

Steps To Reproduce:

Create a client using these class methods:

/**
 * @var \Nylas\Client
 */
private Client $nylas;
  
/**
 * Nylas service constructor
 */
public function __construct()
{
  $this->nylas = self::getNylasClient();
}

/**
 * Create a new Nylas client
 *
 * @return \Nylas\Client
 */
public static function getNylasClient(): Client
  {
    $options = [
      'debug'            => config('app.debug'),
      'region'           => config('services.nylas.region'),
      'log_file'         => dirname(__FILE__) . '/nylas.log',
      'client_id'        => config('services.nylas.client_id'),
      'client_secret'    => config('services.nylas.client_secret'),
    ];

    return new Client($options);
  }

and call

$this->nylas->Options->setAccessToken("my_access_token");

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions