2

I have a new error after upgrading, that should not be related to the upgrade.

I am using SendInBlue Php Library in my project, loaded in my composer with :

"sendinblue/api-v3-sdk": "*@dev",

Used in my Service with:

use SendinBlue\Client\Api\SMTPApi;
use SendinBlue\Client\Model\SendEmail;

Called with :

$api_instance = new SMTPApi();

Since the upgrade I have a new error:

Attempted to load class "SMTPApi" from namespace "SendinBlue\Client\Api". Did you forget a "use" statement for another namespace?

I tried clear cache, have rm -rf remove cache, Invalidate my phpStorm Cache + Restart, remove the two USE statement, and then look what is displayed when I try to create a new instance, but it's still the same USE statement that is added.

If I COMMAND+CLICK on the class called, it does show the related class (SMTPApi).

I am totally lost on what could be the problem here, is it symfony upgrade related ? Is it composer update that changed other things ?

for more information, here is the header of my Service:

namespace App\Services;

use FOS\UserBundle\Mailer\MailerInterface;
use FOS\UserBundle\Model\UserInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Routing\Router;
use SendinBlue\Client\Api\SMTPApi;
use SendinBlue\Client\Model\SendEmail; 

And here is my composer:

{ [...]

"require": {
    "php": "^7.1.3",
    "ext-iconv": "*",
    "aws/aws-sdk-php": "^3.69",
    "beelab/tag-bundle": "^1.4.0",
    "friendsofsymfony/user-bundle": "^2.1",
    "google/apiclient": "^2.0",
    "gumlet/php-image-resize": "^1.9",
    "kunalvarma05/dropbox-php-sdk": "^0.2.1",
    "lildude/phpsmug": "^4.0",
    "sendinblue/api-v3-sdk": "*@dev",
    "sensio/framework-extra-bundle": "^5.1",
    "sensiolabs/security-checker": "^4.1",
    "symfony/apache-pack": "^1.0",
    "symfony/asset": "^4.2",
    "symfony/console": "^4.2",
    "symfony/debug-pack": "^1.0",
    "symfony/dependency-injection": "^4.2",
    "symfony/dotenv": "^4.2",
    "symfony/flex": "^1.0",
    "symfony/form": "^4.2",
    "symfony/framework-bundle": "^4.2",
    "symfony/lock": "^4.2",
    "symfony/maker-bundle": "^1.4",
    "symfony/monolog-bundle": "^3.3",
    "symfony/orm-pack": "^1.0",
    "symfony/swiftmailer-bundle": "^3.0",
    "symfony/translation": "^4.2",
    "symfony/twig-bundle": "4.2",
    "symfony/web-server-bundle": "^4.2",
    "symfony/yaml": "^4.2"
},
"require-dev": {
    "easycorp/easy-log-handler": "^1.0.2",
    "symfony/debug-bundle": "^3.3|^4.2",
    "symfony/profiler-pack": "^1.0",
    "symfony/var-dumper": "^3.3|^4.2"
},
[...]
}
Antoine Nedelec
  • 655
  • 8
  • 21
  • Strange. What happens if you instantiate with the fully qualified name; i.e: `new \SendinBlue\Client\Api\SMTPApi()`? Same issue? – Darragh Enright Feb 12 '19 at 18:49
  • Yes I tried that too. Forgot to put it in the list (tried again to be sure but no) – Antoine Nedelec Feb 12 '19 at 18:52
  • 1
    Weird indeed. If you're using XDebug, I would recommend adding a breakpoint within the `Symfony\Component\Debug\Exception\ClassNotFoundException` class (the one that displays that message) and observe what's going on by browsing the call stack (probably comes from Symfony's class loader). – Jeto Feb 12 '19 at 18:56
  • 1
    The next things I would try would be to remove the vendor lib and do `composer install` again, or change the dependency version of that library to an older tagged version—perhaps it was upgraded in the release and that introduced an issue. Speculating wildly here! – Darragh Enright Feb 12 '19 at 18:58
  • 1
    On a "normal" PHP project (using Composer's own autoloader), I've tested it with the exact same version and didn't get any error, so it most likely doesn't come from that API. But yeah probably some kind of cache thing, even though OP already attempted many things in that regard. – Jeto Feb 12 '19 at 19:00
  • All right I reverted my library to 6.0.0 and it seems to be working. I guess i'll inform the github of this extension of the incoming problem. Thanks for the help :) – Antoine Nedelec Feb 12 '19 at 19:06

1 Answers1

0

As said up here, needed to revert the library. Maybe now it's fixed by the creator on GIT.

Antoine Nedelec
  • 655
  • 8
  • 21