-
Notifications
You must be signed in to change notification settings - Fork 43
/
sami.php
39 lines (33 loc) · 867 Bytes
/
sami.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
require_once __DIR__ . '/vendor/autoload.php';
use Sami\Sami;
use Sami\Version\GitVersionCollection;
use Symfony\Component\Finder\Finder;
use Sami\Parser\Filter\PublicFilter;
$dir = __DIR__ . '/src';
$iterator = Finder::create()
->files()
->name('*.php')
->in($dir)
;
$versions = GitVersionCollection::create($dir)
->addFromTags('v0.*')
->add('master', 'master branch')
;
$sami = new Sami($iterator, [
'title' => 'PHP Code Generator API',
'theme' => 'default',
'versions' => $versions,
'build_dir' => __DIR__ . '/api/%version%',
'cache_dir' => __DIR__ . '/cache/%version%',
'default_opened_level' => 2,
'sort_class_properties' => true,
'sort_class_methods' => true,
'sort_class_constants' => true,
'sort_class_traits' => true,
'sort_class_interfaces' => true
]);
$sami['filter'] = function () {
return new PublicFilter();
};
return $sami;