How dannyspd/vscode-php-getters-setters works
This is a VS Code extension that generates PHP getters and setters from class properties. The main workflow starts with a user invoking an editor command, then analyzes the selected property and produces methods for insertion; configuration and custom templates affect generation, and the extension can redirect the editor afterward. The repository also contains constructor-generation and PHP/API-oriented utilities. Edges are limited to relationships shown in the excerpts, SOURCE INDEX references, or README; some utility modules have no evidenced runtime connection here.
Main entry points: extension.ts Commands and orchestration · CreateConstructorFromProperties.ts Constructor generation · Property.ts Property analysis · TemplatesManager.ts Template discovery
Components 23
Editor workflow
- Commands and orchestration
src/extension.ts
Property generation
- Property analysis
src/Property.ts - Name conversion
src/Names.ts - Editor insertion
src/Renderer.ts - Editor redirection
src/Redirector.ts - Getter and setter output
src/extension.ts
Templates and settings
- Extension settings
src/Configuration.ts - Template discovery
src/TemplatesManager.ts - Custom templates
PHP utilities
- Constructor generation
src/Extras/PHP/CreateConstructorFromProperties.ts - Function inspection
src/FunctionDefinition.ts - Composer PSR-4 mapping
src/Composer.ts - Path utilities
src/PathUtils.ts - Namespace resolution
src/Extras/PHP/ResolveNamespace.ts - JSON to PHP
src/Extras/PHP/JsonToPhp.ts - PHP text transforms
src/Extras/PHP/TextTransforms.ts - Route parsing
src/Extras/PHP/Router.ts - Document text model
src/Extras/DocumentModel.ts - Endpoint records
src/Extras/EndPoint.ts - Axios consumer
src/Extras/Consumers/AxiosConsumer.ts - PHP cURL consumer
src/Extras/Consumers/CurlPhpConsumer.ts - Text template generation
src/Extras/GenerateTemplateFromText/GenerateTemplate.ts
Other components
- VS Code user
Connections 25
- VS Code user → Commands and orchestration: invokes command
README.md - Commands and orchestration → Property analysis: analyzes selection
src/extension.ts - Property analysis → Name conversion: converts names
src/Property.ts - Commands and orchestration → Extension settings: reads settings
src/extension.ts - Commands and orchestration → Template discovery: checks templates
src/extension.ts - Template discovery → Extension settings: reads template directory
src/TemplatesManager.ts - Template discovery → Custom templates: locates files
src/TemplatesManager.ts - Commands and orchestration → Getter and setter output: generates methods
README.md - Getter and setter output → Property analysis: uses property data
README.md - Commands and orchestration → Editor insertion: inserts generated text
src/extension.ts - Editor insertion → Editor redirection: redirects editor
src/Renderer.ts - Commands and orchestration → Editor redirection: configures redirection
src/extension.ts - Commands and orchestration → Route parsing: parses routes
src/extension.ts - Route parsing → Document text model: splits document text
src/Extras/PHP/Router.ts - Route parsing → Endpoint records: creates records
src/Extras/PHP/Router.ts - Commands and orchestration → Constructor generation: offers constructor generation
src/extension.ts - Constructor generation → Property analysis: collects properties
src/Extras/PHP/CreateConstructorFromProperties.ts - Constructor generation → Function inspection: finds insertion point
src/Extras/PHP/CreateConstructorFromProperties.ts - Constructor generation → Editor insertion: inserts constructor
src/Extras/PHP/CreateConstructorFromProperties.ts - Namespace resolution → Composer PSR-4 mapping: resolves mappings
src/Extras/PHP/ResolveNamespace.ts - Composer PSR-4 mapping → Path utilities: normalizes paths
src/Composer.ts - JSON to PHP → Name conversion: converts identifiers
src/Extras/PHP/JsonToPhp.ts - PHP text transforms → Name conversion: uses name conversion
src/Extras/PHP/TextTransforms.ts - Axios consumer → Endpoint records: uses endpoint data
src/Extras/Consumers/AxiosConsumer.ts - PHP cURL consumer → Endpoint records: uses endpoint data
src/Extras/Consumers/CurlPhpConsumer.ts