fuelでCannot declare class Controller\Hoge, because the name is already in useが起きたとき

カテゴリー
PHP フレークワーク

エラー内容

ErrorException [ Compile Error ]:
Cannot declare class Controller\Hoge, because the name is already in use
APPPATH/classes/controller/hoge.php @ line 0
0
1<?php
2
3namespace Controller;
4
5use \Controller_Rest as Rest;
Backtrace
COREPATH/bootstrap.php @ line 71

原因

実はこのエラーが出るときは必ずしもクラスの重複が原因ではない。例えばルーティングの記述ミスや、namespaceの記述ミスでも発生する。

原因の例

今回は下記が原因だった。

    'hoge' => 'hogeindex', // hoge/indexが正しい