phpcompat

package
v0.0.0-...-e9fe98c Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// PhpLatest represents the latest version of PHP.
	PhpLatest = "7.3.8"
)

Functions

func BreaksVersions

func BreaksVersions(message tide.PhpcsFilesMessage) []string

BreaksVersions takes a PHPCompatibility sniff code and returns the versions that break for that code.

func ExcludeVersions

func ExcludeVersions(versions, exclude []string) []string

ExcludeVersions removes the excluded versions from the given versions.

func GetVersionParts

func GetVersionParts(version, lowIn string) (low, high, majorMinor, reported string)

GetVersionParts returns a version range (low and high) as well as the majorMinor for the given version and the given version as `reported`.

func MergeVersions

func MergeVersions(n ...[]string) []string

MergeVersions takes slices of versions and returns a slice with unique values.

func NonBreakingVersions

func NonBreakingVersions(message tide.PhpcsFilesMessage) []string

NonBreakingVersions takes a PHPCompatibility sniff code and returns the versions that are warnings.

func PhpMajorVersions

func PhpMajorVersions() []string

PhpMajorVersions returns only the major.minor parts from the `versions` variable as slice of strings.

func PreviousVersion

func PreviousVersion(version string) string

PreviousVersion returns the immediate previous version given a version.

func VersionParts

func VersionParts(version string) (int, int, int)

VersionParts takes a version given as string and returns each part as an int.

Types

type Compatibility

type Compatibility struct {
	Source string              `json:"source"`
	Breaks *CompatibilityRange `json:"breaks,omitempty"`
	Warns  *CompatibilityRange `json:"warns,omitempty"`
}

Compatibility describes a compatibility report with breaking and warning ranges.

func Parse

Parse takes a tide.PhpcsFilesMessage message and returns a Compatibility struct. It parses using the above verbs.

type CompatibilityRange

type CompatibilityRange struct {
	Low        string `json:"low"`
	High       string `json:"high"`
	Reported   string `json:"reported"`
	MajorMinor string `json:"major_minor"`
}

CompatibilityRange describes the violation's PHP version range.

Jump to

Keyboard shortcuts

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