-
-
Notifications
You must be signed in to change notification settings - Fork 122
Added feature of viewing method source code without external links #232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c85153c
b35db8f
875c8a5
b668bfe
ceff357
29b3ce7
716afd7
bca8110
83c8789
86fb0c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,10 @@ class MethodDoc extends FunctionDoc | |
| public $visibility; | ||
| // will be set by creating class | ||
| public $definedBy; | ||
| /** | ||
| * @var string | ||
| */ | ||
| public $sourceCode = ''; | ||
|
|
||
|
|
||
| /** | ||
|
|
@@ -44,5 +48,10 @@ public function __construct($reflector = null, $context = null, $config = []) | |
| $this->isStatic = $reflector->isStatic(); | ||
|
|
||
| $this->visibility = $reflector->getVisibility(); | ||
|
|
||
| $lines = file($this->sourceFile); | ||
| for ($i = $this->startLine - 1; $i <= $this->endLine - 1; $i++) { | ||
| $this->sourceCode .= substr($lines[$i], 4); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is "4" exactly? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Number of spaces. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it's the number of spaces we need to remove from the beginning of each line. I thought of existence of cases with different amount of spaces used for indentation, tabs instead of spaces and so on. But we discussed it with @samdark and decided to leave it as is now. |
||
| } | ||
| } | ||
| } | ||