I'm creating an API wrapper at the moment, and I decided to create an index.php which loads the Client, just for testing/debugging purposes.
Here's my index.php
require_once("src/API/Client.php"); $client = new \API\Client(); Here's my API\Client
namespace API; class Client { public function __construct() { $this->_requester = new Client\Request(); return $this; } } The error I'm getting is that API\Client\Request is not found in the Client.php
It does exist, and can be viewed below:
namespace API\Client class Request { protected $_requestUrl; public function __construct() { return $this; } } This is my first foray into making an application that has fully namespaced classes, so I'd appreciate your help in getting this working.
Requestinstead of hard coding it in constructor:$client = new \API\Client(new \API\Client\Request);