0

I'm trying to use respect validations in my PhpStorm's project. This is my first time using a Composer dependency and I runned into some trouble.

This is my setup:

Image of my PhpStorm setup

I have it installed, but the the very first use line throws the exception:

Class 'Respect\Validation\Validator' not found in C:\xampp\htdocs\xxx\api\private\verifyUser.php on line 7

What else do I have to do to make PHP find the library?

LazyOne
  • 158,824
  • 45
  • 388
  • 391
  • 1
    does this help? https://stackoverflow.com/questions/38950734/class-validator-not-found-in-respect-validation-lib – Alex.Barylski Jan 04 '18 at 17:08
  • 3
    TBH this error has nothing to do with PhpStorm -- it's PHP itself who complains not PhpStorm. But for the actual question -- did you load your composer's `autoload.php` that handles class autoloading? – LazyOne Jan 04 '18 at 17:20
  • I now added "require_once '..\..\..\vendor\autoload.php';" but I'm still getting the same. –  Jan 04 '18 at 22:16
  • Got that one fixed aswell. Added "\__DIR__" before the path to make it work. Very confusing considering the IDE acts like I'm entering the correct path by showing me the folders of the directory I'm in. –  Jan 04 '18 at 22:39

0 Answers0