title: Fatal error: Cannot declare class
body: <p>I can not understand why php gives me an error</p>
  
  <blockquote>
    <p>"Fatal error: Cannot declare class rex\builder\RexBuilder, because the
    name is already in use in /var/www/site2.dev/App/rex/RexBuilder.php on
    line 12"</p>
  </blockquote>
  
  <p>RexBuilder static class, and it is called only 1 time.
  I did a search on the project, no longer classes with the same name.</p>
  
  <pre><code>    &lt;?php
  
  namespace rex\builder;
  
  require_once 'Router.php';
  
  use rex\router\Router;
  
  error_reporting(E_ALL);
  ini_set('display_errors', 1);
  
  class RexBuilder {
  
      public static function collector($array) {
          $router = new Router();
          foreach ($array as $key =&gt; $val) {
              $router-&gt;get($val-&gt;getMethod(), $val-&gt;getInterfaces(), $val-&gt;getHandler());
          }
          $router-&gt;init();
      }
  }
  ?&gt;
  </code></pre>
  
  <p>Call the class in index.php</p>
  
  <pre><code>RexBuilder::collector(array(
  new BuildModel('POST', '/api/v1/user/register', new \api\register\Registration()),
  new BuildModel('POST', '/api/v1/user/login', new \api\login\Login())));
  </code></pre>
  
  <p>More This class is not used</p>