config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// SourceDirs lists directories to scan for PHP files.
	SourceDirs []string `yaml:"source_dirs"`

	// PHPVersion specifies the PHP version for the parser (e.g. "8.1").
	PHPVersion string `yaml:"php_version"`

	// OutputFormat: "svg", "png", "dot".
	OutputFormat string `yaml:"output_format"`

	// OutputFile is the path to the rendered output.
	OutputFile string `yaml:"output_file"`

	// GroupBy controls graph clustering: "class", "namespace", or "none".
	GroupBy string `yaml:"group_by"`

	// Granularity controls the graph detail: "method" or "class".
	Granularity string `yaml:"granularity"`

	// Layout is the Graphviz layout engine: "dot", "circo", "fdp", "neato", "sfdp", "twopi", etc.
	Layout string `yaml:"layout"`

	// RankDir sets graph direction: "TB", "LR", "BT", "RL".
	RankDir string `yaml:"rank_dir"`

	// MaxDepth limits the call chain depth from entry points (0 = unlimited).
	MaxDepth int `yaml:"max_depth"`

	// EntryPoints restricts the graph to calls reachable from these FQN methods.
	// Example: ["App\\Controllers\\UserController::index"]
	EntryPoints []string `yaml:"entry_points"`

	// Workers is the number of parallel file-parsing goroutines.
	Workers int `yaml:"workers"`

	// ResolveTypes enables heuristic type resolution for $var->method() calls.
	ResolveTypes bool `yaml:"resolve_types"`

	// ShowUnresolved controls whether unresolved calls appear in the graph (dashed edges).
	ShowUnresolved bool `yaml:"show_unresolved"`

	// ShowFunctions controls whether standalone function calls appear in the graph.
	ShowFunctions bool `yaml:"show_functions"`

	// Filters control which classes/namespaces to include or exclude.
	Filters FilterConfig `yaml:"filters"`

	// TypeMappings allows manual variable → FQN type overrides.
	// Key is "$varName" or "ClassName::$propName", value is FQN.
	TypeMappings map[string]string `yaml:"type_mappings"`
}

Config is the root configuration structure loaded from config.yaml.

func Load

func Load(path string) (*Config, error)

Load reads and parses a YAML config file.

type FilterConfig

type FilterConfig struct {
	IncludeNamespaces []string `yaml:"include_namespaces"`
	ExcludeNamespaces []string `yaml:"exclude_namespaces"`
	IncludeClasses    []string `yaml:"include_classes"`
	ExcludeClasses    []string `yaml:"exclude_classes"`
	ExcludeMethods    []string `yaml:"exclude_methods"`
}

FilterConfig holds include/exclude filter lists.

Jump to

Keyboard shortcuts

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