Documentation
¶
Overview ¶
Package phplint checks PHP source against an explicit PHP minor-language profile without invoking a PHP runtime.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Diagnostic ¶
type Diagnostic struct {
Filename string
Message string
Phase Phase
Start Position
End Position
// SourceLine is the text of the line Start points into, without the
// line terminator. It is empty when the position is unknown.
SourceLine string
}
Diagnostic describes one source-level lint failure.
func Lint ¶
func Lint(filename string, source []byte, options Options) (diagnostics []Diagnostic, err error)
Lint parses and compile-validates one PHP source file.
Syntax and compile failures are returned as diagnostics. The error return is reserved for invalid options or an internal linter failure.
func (Diagnostic) String ¶
func (d Diagnostic) String() string
type Version ¶
type Version uint8
Version identifies a PHP minor-language profile.
func ParseVersion ¶
ParseVersion parses one of the supported PHP minor versions.
Patch versions are deliberately rejected: PHP syntax profiles are maintained at minor-version granularity.
func SupportedVersions ¶
func SupportedVersions() []Version
SupportedVersions returns all supported PHP profiles in ascending order.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
phplint
command
|
|
|
internal
|
|
|
parser
A Parser for PHP written in Go
|
A Parser for PHP written in Go |
|
php7
line internal/php7/scanner.rl:1
|
line internal/php7/scanner.rl:1 |
|
php8
line internal/php8/php8.y:2
|
line internal/php8/php8.y:2 |
|
visitor/nsresolver
Package visitor contains walker.visitor implementations
|
Package visitor contains walker.visitor implementations |