I have a ready engine with different classes in PHP. I need to embed a function using Google Cloud Vision, which uses the composer and the namespace.

include 'vendor/autoload.php'; use Google\Cloud\Vision\VisionClient; $vision = new VisionClient([ 'keyFilePath' => $keyFilePath ]); ... 

In a separate file, the function works correctly. But if I insert this function into the engine before the code in which I need to use it, then all the following class connections by the engine code do not occur and PHP swears that it does not see the next class, something like:

Fatal error: Uncaught Error: Class 'feed' not found in ...

If I insert the code at the very end, then, accordingly, it does not see the function that I need to call. Please help me correctly connect the autoload and the Google Cloud namespace to the finished engine. Preferably with examples. Many thanks in advance to all who responded.

    0