phpcbf

package
v0.0.0-...-e49a3f0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Instance

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

Instance is a wrapper around the 'phpcbf' cli for formatting code. This implementation preemptively starts an instance of the command, So that each call to Format does not need to wait for php and the phpcbf bootstrap. This does mean that there will always be a 'phpcbf' process instance running.

func NewInstance

func NewInstance() *Instance

NewInstance initializes a new instance.

func (*Instance) Close

func (p *Instance) Close()

func (*Instance) Format

func (p *Instance) Format(code []byte) ([]byte, error)

func (*Instance) FormatFileEdits

func (p *Instance) FormatFileEdits(path string) ([]protocol.TextEdit, error)

TODO: should probably not be in this package.

func (*Instance) HasExecutable

func (p *Instance) HasExecutable() bool

func (*Instance) Init

func (p *Instance) Init()

Jump to

Keyboard shortcuts

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