From 768b859d9bbaa5621e711f03d28cfc0dd0b315d0 Mon Sep 17 00:00:00 2001 From: David Supplee Date: Fri, 2 Feb 2018 14:41:26 -0500 Subject: [PATCH] Use correct source link (#881) * use correct source link * remove unused properties --- dev/src/DocGenerator/DocGenerator.php | 2 -- dev/src/DocGenerator/Parser/CodeParser.php | 13 +------------ 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/dev/src/DocGenerator/DocGenerator.php b/dev/src/DocGenerator/DocGenerator.php index 8870c39c97c3..f681a499edf8 100644 --- a/dev/src/DocGenerator/DocGenerator.php +++ b/dev/src/DocGenerator/DocGenerator.php @@ -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 { diff --git a/dev/src/DocGenerator/Parser/CodeParser.php b/dev/src/DocGenerator/Parser/CodeParser.php index 9c47afa83adf..65aeb6283f28 100644 --- a/dev/src/DocGenerator/Parser/CodeParser.php +++ b/dev/src/DocGenerator/Parser/CodeParser.php @@ -39,7 +39,6 @@ class CodeParser implements ParserInterface private static $composerFiles = []; private $path; - private $fileName; private $register; private $markdown; private $projectRoot; @@ -48,21 +47,17 @@ 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; @@ -70,7 +65,6 @@ public function __construct( $this->componentId = $componentId; $this->manifestPath = $manifestPath; $this->release = $release; - $this->basePath = $basePath; $this->isComponent = $isComponent; } @@ -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)