Attempted to call an undefined method named "validateAccessToken" when using Mautic api-library in Symfony
<p>I'm trying to use mautic/api-library inside my Symfony project. I'm using Symfony 2.8.9 with PHP 5.6.14.</p>

<p>I've included api-library project in composer and in the autoload.php file. In my controller, I've declared api-library classes:</p>

<pre><code>use Mautic\Auth\ApiAuth;
use Mautic\Auth\OAuth;
</code></pre>

<p>And tried to get a token from my mautic installation:</p>

<pre><code>$settings = array(
    'baseUrl'      =&gt; 'http://mymauticinstallation.com',
    'version'      =&gt; 'OAuth1a',
    'clientKey'    =&gt; 'myCLientKey',    
    'clientSecret' =&gt; 'mySecretClient',  
    'callback'     =&gt; 'https://api.mysymfonyapp.com/'
);
$auth = new ApiAuth();
$auth-&gt;newAuth($settings);
if ($auth-&gt;validateAccessToken()) {
    if ($auth-&gt;accessTokenUpdated()) {
        $accessTokenData = $auth-&gt;getAccessTokenData();
    }
}
</code></pre>

<p>But when I try to run this code I'm getting this error in my console:</p>

<pre><code>request.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\UndefinedMethodException: "Attempted to call an undefined method named "validateAccessToken" of class "Mautic\Auth\ApiAuth"
</code></pre>

<p>Looking inside mautic <code>ApiAuth</code> class, <code>newAuth</code> method uses a instantiation by refection:</p>

<pre><code>public function newAuth($parameters = array(), $authMethod = 'OAuth')
{
    $class      = 'Mautic\\Auth\\'.$authMethod;
    $authObject = new $class();

    ...

    return $authObject;
}
</code></pre>

<p>According to the exception message, the reflection is not returning an OAuth class instance. Do anyone know what is causing this? I've checked and I'm meeting minimum requirements for PHP and Symfony. Is there anything related to PHP version and reflection?</p>

<p>Thanks in advance.</p>