config

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: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name           = "phpls"
	Version        = "0.0.1-dev"
	SchemaLocation = "https://raw.githubusercontent.com/laytan/phpls/main/internal/config/phpls.schema.json"
)

Variables

This section is empty.

Functions

func Parse

func Parse(args []string)

Parse loads the configuration from all the config files, environment variables, cli flags, and defaults. Validates it and sets it co Current. Parse exits on its own when there were errors or invalid configuration values. args should be all the flags, not the program name or any subcommand name.

Types

type Analyzer

type Analyzer struct {
	Method  DiagnosticsMethod `` /* 191-byte string literal not displayed */
	Enabled bool              `json:"enabled,omitempty" default:"true"`
}

type Diagnostics

type Diagnostics struct {
	Enabled bool    `json:"enabled,omitempty" default:"true"`
	Phpstan Phpstan `json:"phpstan,omitempty"`
	Phpcs   Phpcs   `json:"phpcs,omitempty"`
}

type DiagnosticsMethod

type DiagnosticsMethod string
const (
	DiagnosticsOnSave   DiagnosticsMethod = "ON_SAVE"
	DiagnosticsOnChange DiagnosticsMethod = "ON_CHANGE"
)

type Php

type Php struct {
	Binary  string `` /* 210-byte string literal not displayed */
	Version string `` /* 252-byte string literal not displayed */
}

type Phpcbf

type Phpcbf struct {
	Enabled  bool     `` /* 208-byte string literal not displayed */
	Binary   []string `` /* 310-byte string literal not displayed */
	Standard string   `` /* 278-byte string literal not displayed */
}

type Phpcs

type Phpcs struct {
	Analyzer
	Binary []string `` /* 220-byte string literal not displayed */
}

type Phpstan

type Phpstan struct {
	Analyzer
	Binary []string `` /* 230-byte string literal not displayed */
}

type Schema

type Schema struct {
	// TODO: implement usage of this.
	Php Php `json:"php,omitempty"`
	// TODO: implement usage of this.
	Phpcbf             Phpcbf      `json:"phpcbf,omitempty"`
	Diagnostics        Diagnostics `json:"diagnostics,omitempty"`
	Extensions         []string    `` /* 237-byte string literal not displayed */
	IgnoredDirectories []string    `` /* 315-byte string literal not displayed */
	Server             Server      `json:"server,omitempty"`
	Statsviz           Statsviz    `json:"statsviz,omitempty"`
	CachePath          string      `` /* 306-byte string literal not displayed */
	DumpConfig         bool        `` /* 307-byte string literal not displayed */

	LogsPath   string                 `json:"-" flag:"-"`
	StubsPath  string                 `json:"-" flag:"-"`
	PhpVersion *phpversion.PHPVersion `json:"-" flag:"-"`
}
var Current *Schema

func Default

func Default() *Schema

func DefaultWithoutComputed

func DefaultWithoutComputed() *Schema

type Server

type Server struct {
	Communication connection.ConnType `` /* 207-byte string literal not displayed */
	URL           string              `` /* 202-byte string literal not displayed */
	ClientPid     uint                `` /* 245-byte string literal not displayed */
}

type Statsviz

type Statsviz struct {
	Enabled bool   `` /* 298-byte string literal not displayed */
	URL     string `` /* 208-byte string literal not displayed */
}

Jump to

Keyboard shortcuts

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