Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetInclude ¶ added in v0.5.0
func SetInclude(path string)
SetInclude names a file to run against the name registry before any file is checked, which is what lets the linter see an application rather than one file of it: with `--include vendor/autoload.php` a name resolves against the classmap rather than against the standard library alone.
It must be called before the first File(). The registry is built once per process, because registration is deterministic.
Types ¶
type Diagnostic ¶
type Diagnostic struct {
File string
Line int
Message string
// Fatal marks a finding the program cannot survive, as against one it
// might: a call to a function some host registers is a warning because the
// linter cannot see every binding, but a redeclaration is refused by the
// runtime whatever is registered. A fatal finding fails the lint run.
Fatal bool
}
Diagnostic is one lint finding.
func File ¶
func File(name, src string) ([]Diagnostic, error)
File parses and lints one PHP source file.
func FlatstackFile ¶ added in v0.2.1
func FlatstackFile(name, src string) (Diagnostic, error)
FlatstackFile checks whether a single PHP source file is compatible with flatstack engine.
func FlatstackPaths ¶ added in v0.2.1
func FlatstackPaths(paths []string) ([]Diagnostic, error)
FlatstackPaths checks flatstack compatibility for all files matched by paths.
func Paths ¶
func Paths(paths []string) ([]Diagnostic, error)
Paths lints each file selected by the provided Go-style path patterns.
func (Diagnostic) String ¶
func (d Diagnostic) String() string
String renders the finding as a line a terminal prints: file, line, message, with the position left out when the finding is about no file in particular.