utils

package
v0.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BinaryOpString added in v0.5.0

func BinaryOpString(n ir.Node) string

func FindPHPFiles added in v0.5.2

func FindPHPFiles(root string) ([]string, error)

FindPHPFiles traverses the file system starting with the passed folder and finding all files with a .php extension.

func FindVarNode added in v0.5.0

func FindVarNode(n ir.Node) ir.Node

FindVarNode returns expression variable node root. If expression doesn't start from a variable, returns nil.

func InCoalesceOrIsset added in v0.5.0

func InCoalesceOrIsset(path irutil.NodePath) bool

func InVendor added in v0.5.0

func InVendor(path string) bool

func IsCapitalized added in v0.5.0

func IsCapitalized(s string) bool

IsCapitalized reports whether s starts with an upper case letter.

func IsPHPKeyword added in v0.5.0

func IsPHPKeyword(word string) bool

func IsQuote added in v0.5.0

func IsQuote(r rune) bool

func IsSpecialClassName

func IsSpecialClassName(n ir.Node) bool

IsSpecialClassName checks if the passed node is a special class name.

func NameNodeEquals

func NameNodeEquals(n ir.Node, s string) bool

NameNodeEquals checks whether n node name value is identical to s.

func NameNodeToString

func NameNodeToString(n ir.Node) string

NameNodeToString converts nodes of *name.Name, and *node.Identifier to string. This function is a helper function to aid printing function names, not for actual code analysis.

func VarToString added in v0.5.0

func VarToString(v ir.Node) string

Types

type CommentParser added in v0.5.2

type CommentParser struct {
	// contains filtered or unexported fields
}

func NewCommentParser added in v0.5.2

func NewCommentParser(comment string, line int) *CommentParser

func (*CommentParser) ParseExpectation added in v0.5.2

func (c *CommentParser) ParseExpectation() (wants []string, err error)

ParseExpectation parses a string describing expected errors like

want `error description 1` [and` error description 2` and `error 3` ...]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL