original_string: public function addEntityDirectory($namespace, $directory)
      {
          if (!is_dir($directory)) {
              return;
          }
          $files = new \DirectoryIterator($directory);
  
          foreach ($files as $file) {
              if ($file->isDir() && !$file->isDot()) {
                  $this->addEntityDirectory($namespace.'\\'.basename($file->getPathname()) , $file->getPathname());
                  continue;
              }
  
              if (!$file->isFile()) {
                  continue;
              }
  
              $class = $namespace.'\\'.$file->getBasename('.php');
              $r = new \ReflectionClass($class);
              if ($r->isSubclassOf('ActiveDoctrine\Entity\Entity') && !$r->isAbstract()) {
                  $this->addEntityClass($class);
              }
          }
      }
code: public function addEntityDirectory($namespace, $directory)
      {
          if (!is_dir($directory)) {
              return;
          }
          $files = new \DirectoryIterator($directory);
  
          foreach ($files as $file) {
              if ($file->isDir() && !$file->isDot()) {
                  $this->addEntityDirectory($namespace.'\\'.basename($file->getPathname()) , $file->getPathname());
                  continue;
              }
  
              if (!$file->isFile()) {
                  continue;
              }
  
              $class = $namespace.'\\'.$file->getBasename('.php');
              $r = new \ReflectionClass($class);
              if ($r->isSubclassOf('ActiveDoctrine\Entity\Entity') && !$r->isAbstract()) {
                  $this->addEntityClass($class);
              }
          }
      }
code_tokens: public function addEntityDirectory ( $ namespace , $ directory ) { if ( ! is_dir ( $ directory ) ) { return ; } $ files = new \ DirectoryIterator ( $ directory ) ; foreach ( $ files as $ file ) { if ( $ file -> isDir ( ) && ! $ file -> isDot ( ) ) { $ this -> addEntityDirectory ( $ namespace . '\\' . basename ( $ file -> getPathname ( ) ) , $ file -> getPathname ( ) ) ; continue ; } if ( ! $ file -> isFile ( ) ) { continue ; } $ class = $ namespace . '\\' . $ file -> getBasename ( '.php' ) ; $ r = new \ ReflectionClass ( $ class ) ; if ( $ r -> isSubclassOf ( 'ActiveDoctrine\Entity\Entity' ) && ! $ r -> isAbstract ( ) ) { $ this -> addEntityClass ( $ class ) ; } } }
docstring: Add all entity classes in a directory.
  
  @param string $namespace The base namespace of the entities
  @param string $directory The directory
docstring_tokens: Add all entity classes in a directory .