|
@@ 232-244 (lines=13) @@
|
| 229 |
|
/** |
| 230 |
|
* Go though interfaces/classes/functions of files and build documentation |
| 231 |
|
*/ |
| 232 |
|
foreach ($file->getInterfaces() as $interface) { |
| 233 |
|
$fqsen = $interface->getFqsen(); |
| 234 |
|
$builder = new InterfaceFileBuilder($file, $interface, $this->extensions); |
| 235 |
|
$filename = $this->dstDir . str_replace('\\', '/', $fqsen) . '.rst'; |
| 236 |
|
file_put_contents($filename, $builder->getContent()); |
| 237 |
|
$this->docFiles[(string)$interface->getFqsen()] = str_replace('\\', '/', $fqsen); |
| 238 |
|
|
| 239 |
|
// also build root namespace in indexes |
| 240 |
|
if (strpos((string)substr($fqsen, 1), '\\') === false) { |
| 241 |
|
$this->project->getRootNamespace()->addInterface($fqsen); |
| 242 |
|
} |
| 243 |
|
$this->debug('Written interface documentation to ' . $filename); |
| 244 |
|
} |
| 245 |
|
|
| 246 |
|
foreach ($file->getClasses() as $class) { |
| 247 |
|
$fqsen = $class->getFqsen(); |
|
@@ 246-258 (lines=13) @@
|
| 243 |
|
$this->debug('Written interface documentation to ' . $filename); |
| 244 |
|
} |
| 245 |
|
|
| 246 |
|
foreach ($file->getClasses() as $class) { |
| 247 |
|
$fqsen = $class->getFqsen(); |
| 248 |
|
$builder = new ClassFileBuilder($file, $class, $this->extensions); |
| 249 |
|
$filename = $this->dstDir . str_replace('\\', '/', $fqsen) . '.rst'; |
| 250 |
|
file_put_contents($filename, $builder->getContent()); |
| 251 |
|
$this->docFiles[(string)$class->getFqsen()] = str_replace('\\', '/', $fqsen); |
| 252 |
|
|
| 253 |
|
// also build root namespace in indexes |
| 254 |
|
if (strpos((string)substr($class->getFqsen(), 1), '\\') === false) { |
| 255 |
|
$this->project->getRootNamespace()->addClass($fqsen); |
| 256 |
|
} |
| 257 |
|
$this->debug('Written class documentation to ' . $filename); |
| 258 |
|
} |
| 259 |
|
|
| 260 |
|
foreach ($file->getTraits() as $trait) { |
| 261 |
|
$fqsen = $trait->getFqsen(); |
|
@@ 260-272 (lines=13) @@
|
| 257 |
|
$this->debug('Written class documentation to ' . $filename); |
| 258 |
|
} |
| 259 |
|
|
| 260 |
|
foreach ($file->getTraits() as $trait) { |
| 261 |
|
$fqsen = $trait->getFqsen(); |
| 262 |
|
$builder = new TraitFileBuilder($file, $trait, $this->extensions); |
| 263 |
|
$filename = $this->dstDir . str_replace('\\', '/', $fqsen) . '.rst'; |
| 264 |
|
file_put_contents($filename, $builder->getContent()); |
| 265 |
|
$this->docFiles[(string)$trait->getFqsen()] = str_replace('\\', '/', $fqsen); |
| 266 |
|
|
| 267 |
|
// also build root namespace in indexes |
| 268 |
|
if (strpos((string)substr($fqsen, 1), '\\') === false) { |
| 269 |
|
$this->project->getRootNamespace()->addTrait($fqsen); |
| 270 |
|
} |
| 271 |
|
$this->debug('Written trait documentation to ' . $filename); |
| 272 |
|
} |
| 273 |
|
|
| 274 |
|
// build array of functions per namespace |
| 275 |
|
foreach ($file->getFunctions() as $function) { |