Skip to content

Instantly share code, notes, and snippets.

@adrienbrault
Created September 10, 2012 14:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save adrienbrault/3691217 to your computer and use it in GitHub Desktop.
Save adrienbrault/3691217 to your computer and use it in GitHub Desktop.
sami example that includes protected/private properties/methods
<?php
use Sami\Sami;
use Sami\Version\GitVersionCollection;
use Sami\Parser\Filter\TrueFilter;
use Symfony\Component\Finder\Finder;
$iterator = Finder::create()
->files()
->name('*.php')
->exclude('Resources')
->exclude('Tests')
->in($dir = '/path/to/symfony/src')
;
$versions = GitVersionCollection::create($dir)
->addFromTags('v2.0.*')
->add('2.0', '2.0 branch')
->add('master', 'master branch')
;
$sami = new Sami($iterator, array(
'theme' => 'symfony',
'versions' => $versions,
'title' => 'Symfony2 API',
'build_dir' => __DIR__.'/../build/sf2/%version%',
'cache_dir' => __DIR__.'/../cache/sf2/%version%',
'template_dirs' => array(__DIR__.'/themes/symfony'),
'default_opened_level' => 2,
));
$sami['filter'] = $sami->share(function () use () {
return new TrueFilter();
});
return $sami;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment