I'm new to namespaces in PHP and trying to make use of them to load classes.
Whenever I run my code I get class Cheese cannot be found on line x
PHPstorm recognizes the class via the namespaces and enables its methods.
I have the following files / directory structure.
/Project
/App
Mouse.php
/Test
MouseTest.php
Mouse.php
namespace App\Mouse;
class Cheese
{
}
MouseTest.php
namespace Test\MouseTest;
use \App\Mouse\Cheese as Cheese;
class CheeseTest
{
function test() {
$cheese = new Cheese();
$cheese->eat();
}
}