1 | <?php |
||
8 | class Generator { |
||
9 | /** |
||
10 | * @var Queries |
||
11 | */ |
||
12 | protected $queries; |
||
13 | |||
14 | public function __construct(Queries $queries) { |
||
17 | |||
18 | /** |
||
19 | * Generate a report according to config. |
||
20 | * |
||
21 | * @param Config |
||
22 | * @return null |
||
23 | */ |
||
24 | public function generate(Config $config) { |
||
31 | |||
32 | /** |
||
33 | * Load source for report if required. |
||
34 | * |
||
35 | * @param string|null $path |
||
36 | * @return null |
||
37 | */ |
||
38 | protected function maybe_load_source($path) { |
||
47 | |||
48 | /** |
||
49 | * Build a report instance. |
||
50 | * |
||
51 | * @param Config $config |
||
52 | * @throws \RuntimeException if no corresponding class was found. |
||
53 | * @throws \RuntimeException if given class does not inherit from namespace. |
||
54 | * @return Report |
||
55 | */ |
||
56 | protected function build_report($config) { |
||
68 | |||
69 | /** |
||
70 | * Open a handle to write the report to. |
||
71 | * |
||
72 | * @param string $handle_name |
||
73 | * @return resource |
||
74 | */ |
||
75 | protected function open_handle($handle_name) { |
||
82 | |||
83 | /** |
||
84 | * Derive fully qualified class name from the provided class name. |
||
85 | * |
||
86 | * If the class name starts with an "\" it is considered already fully |
||
87 | * qualified. |
||
88 | * If not, we check if $nameReport is found in \Lechimp\Dicto\Report |
||
89 | * namespace or if $name is found in said namespace. |
||
90 | * If that is also not the case, we assume the class is in the global |
||
91 | * namespace. |
||
92 | * |
||
93 | * @return string |
||
94 | */ |
||
95 | protected function fully_qualified_class_name($name) { |
||
109 | } |
||
110 |