function generateApiClassesReference($rootDir, $versionName)
 {
     $iterator = Finder::create()->files()->name('*.php')->notName('tcpdf_config.php')->exclude(array('tests', 'config', 'ScheduledReports/config'))->in(array(PIWIK_DOCUMENT_ROOT . '/core', PIWIK_DOCUMENT_ROOT . '/plugins', PIWIK_DOCUMENT_ROOT . '/libs/PiwikTracker'));
     $sami = new Sami($iterator, array('theme' => 'markdown', 'versions' => $versionName, 'title' => 'Piwik Plugin API', 'build_dir' => $rootDir . '/docs/generated/%version%', 'cache_dir' => $rootDir . '/docs/cache/%version%', 'template_dirs' => array($rootDir . '/generator/template'), 'default_opened_level' => 5, 'include_parent_data' => true, 'filter' => new ApiClassFilter()));
     /** @var Twig_Environment $twig */
     $twig = $sami->offsetGet('twig');
     $twig->addFilter(new Twig_SimpleFilter('inlinelinkparser', function ($description, ClassReflection $class) use($sami) {
         $scope = new Scope();
         $scope->class = $class;
         $scope->classes = $sami->offsetGet('project')->getProjectClasses();
         $scope->namespace = $class->getNamespace();
         $linkConverter = new InlineLinkParser($scope);
         return $linkConverter->parse($description);
     }));
     $twig->addFilter(new Twig_SimpleFilter('linkparser', function ($description, ClassReflection $class) use($sami) {
         $scope = new Scope();
         $scope->class = $class;
         $scope->classes = $sami->offsetGet('project')->getProjectClasses();
         $scope->namespace = $class->getNamespace();
         $linkConverter = new LinkParser($scope);
         return $linkConverter->parse($description);
     }));
     $sami['project']->update();
     return $sami;
 }
 public function generateScope($hook)
 {
     $scope = new Scope();
     $scope->classes = $this->sami->offsetGet('project')->getProjectClasses();
     $scope->namespace = str_replace('/', '\\', $hook['namespace']);
     $scope->class = $scope->findClass($hook['class']);
     return $scope;
 }