phpcode

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package phpcode is the PHP backend for `sf code`: a structural summary of a PHP file (namespace, class/interface/trait/enum, extends/implements, attributes, enum cases, constructor deps, properties, method signatures) and single-method slicing. It reuses the shared VKCOM-based reader (internal/common/php), which normalizes PHP 8.2–8.5 to the 8.1 grammar.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Slice

func Slice(src []byte, symbol string) (string, []string, error)

Slice returns the source of one named method from src.

func Summarize

func Summarize(w io.Writer, path, format string, exported, api bool) (map[string]any, error)

Summarize writes the structural summary of the PHP file at path to w. When api is set and the file declares a class or trait, the methods block becomes the effective public surface — own methods plus those composed via traits and inherited from parent classes (see effectiveSurface). api implies the public-only filter. The json format stays structural (machine output); callers wanting the flattened surface use toon/md.

Types

This section is empty.

Jump to

Keyboard shortcuts

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