Skip to content

Commit

Permalink
Use correct source link (#881)
Browse files Browse the repository at this point in the history
* use correct source link

* remove unused properties
  • Loading branch information
dwsupplee authored Feb 2, 2018
1 parent 5153b88 commit 768b859
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
2 changes: 0 additions & 2 deletions dev/src/DocGenerator/DocGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,11 @@ public function generate($basePath, $pretty)
if ($isPhp) {
$parser = new CodeParser(
$file,
$currentFile,
$fileReflectorRegister,
dirname($this->executionPath),
$this->componentId,
$this->manifestPath,
$this->release,
$basePath,
$this->isComponent
);
} else {
Expand Down
13 changes: 1 addition & 12 deletions dev/src/DocGenerator/Parser/CodeParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class CodeParser implements ParserInterface
private static $composerFiles = [];

private $path;
private $fileName;
private $register;
private $markdown;
private $projectRoot;
Expand All @@ -48,29 +47,24 @@ class CodeParser implements ParserInterface
private $manifestPath;
private $release;
private $isComponent;
private $basePath;

public function __construct(
$path,
$fileName,
ReflectorRegister $register,
$projectRoot,
$componentId,
$manifestPath,
$release,
$basePath,
$isComponent = true
) {
$this->path = $path;
$this->fileName = $fileName;
$this->register = $register;
$this->markdown = \Parsedown::instance();
$this->projectRoot = $projectRoot;
$this->externalTypes = json_decode(file_get_contents($this->projectRoot . '/docs/external-classes.json'), true);
$this->componentId = $componentId;
$this->manifestPath = $manifestPath;
$this->release = $release;
$this->basePath = $basePath;
$this->isComponent = $isComponent;
}

Expand Down Expand Up @@ -181,12 +175,7 @@ private function buildMethodInfo($fileReflector, $reflector)

private function getPath($fileReflector)
{
if (strpos($fileReflector->getFileName(), $this->basePath) !== false) {
$fileSplit = explode($this->basePath, trim($fileReflector->getFileName(), '/'));
return 'src/' . trim($fileSplit[1], '/');
}

return 'src/'. trim(explode('src', $fileReflector->getFileName())[1]);
return 'src' . trim(explode('src', $fileReflector->getFileName())[1]);
}

private function buildDocument($fileReflector, $reflector)
Expand Down

0 comments on commit 768b859

Please sign in to comment.