PHP Designing Interfaces in PHP Introducing Interfaces Implementing an Interface

Don Macarthur
Don Macarthur
28,278 Points

'Interface "RepositoryInterface" not found error'

I'm really stuck on this video.

After previewing my workspace at the creation of the $repo variable in the config.php file I get a fatal error of :-

"Fatal error: Interface 'RepositoryInterface' not found in /home/treehouse/workspace/src/classes/jsonRepository.php on line 3"

I've pored over the video and Alena's code many times and can't see my error. I've also restarted from the beginning of the video and recreated all my files and code but still get the error.

I've posted a snapshot of my workspace below.

Thanks in advance for any help Don :-)

2 Answers

Jennifer Nordell
Jennifer Nordell
Treehouse Staff

Hi there! I took the liberty of forking your workspace and looking around. I did manage to get it to the point where it has the same errors she has at this point in the videos. Now, I'm not exactly sure how this happened, but I found the error.

In interfaces/RepositoryInterface.php on the top line, your code starts with:


For some reason, the php part is removed. It should start with:


I believe at this point that file can't even be interpreted as PHP because of that so it's trying to implment an interface it doesn't have access to (or really exist) at this point. Make that change and see if you can get back on track!

Hope this helps! :sparkles:

Don Macarthur
Don Macarthur
28,278 Points

Well that's embarrassing..... :-) Didn't even think to check for that.

Thanks for taking the time to look it over and the help.

Cheers Don :-)