Skip to content

Release/v1.0.1 - #34

Merged
tolawho merged 30 commits into
mainfrom
release/v1.0.1
Jun 9, 2026
Merged

Release/v1.0.1#34
tolawho merged 30 commits into
mainfrom
release/v1.0.1

Conversation

@tolawho

@tolawho tolawho commented Jun 9, 2026

Copy link
Copy Markdown
Owner

No description provided.

tolawho and others added 30 commits June 5, 2026 22:32
* feat: implement Core Engine for PHP Swagger Generator

- Initialize project with composer.json and PSR-4 structure
- Implement Scanner to find PHP files
- Implement AST Parser and NameResolver for FQCN resolution
- Implement DocBlockCollector using phpstan/phpdoc-parser
- Implement IR and OpenAPI Generator for YAML output
- Add examples and unit tests
- Update SAFe Backlog status to reflect progress on PI-1 Foundation.

* feat: implement Core Engine for PHP Swagger Generator

- Initialize project with composer.json and PSR-4 structure
- Implement Scanner to find PHP files
- Implement AST Parser and NameResolver for FQCN resolution
- Implement DocBlockCollector using phpstan/phpdoc-parser
- Implement IR and OpenAPI Generator for YAML output
- Add examples and unit tests
- Update README with testing instructions
- Update SAFe Backlog status to reflect progress on PI-1 Foundation.

---------

Co-authored-by: tolawho <12527881+tolawho@users.noreply.github.com>
…port (#4)

* feat: implement SchemaRegistry and TypeResolver for advanced type support

- Added SchemaRegistry to manage central schema definitions and avoid duplicates.
- Added TypeResolver to handle nullable types, arrays (e.g., User[]), and class references using PHPDoc types.
- Refactored Core and Generator to utilize the new TypeResolver and SchemaRegistry.
- Updated examples and unit tests to verify support for complex nested structures.
- Updated SAFE_BACKLOG.md to reflect progress on Epic 2 and completed features F2.1 and F2.4.

* feat: implement SchemaRegistry and TypeResolver with full SAFe backlog update

- Restored full content of SAFE_BACKLOG.md (Acceptance Criteria, WSJF, Roadmap).
- Updated SAFE_BACKLOG.md to mark F2.1 and F2.4 as complete.
- Implemented SchemaRegistry for centralized model management.
- Implemented TypeResolver to handle complex PHPDoc types (nullable, arrays).
- Refactored Core and Generator to use new components.
- Verified with unit tests and examples.

---------

Co-authored-by: tolawho <12527881+tolawho@users.noreply.github.com>
…ntation update (#5)

- Implemented SchemaRegistry for centralized schema management and circular reference support.
- Implemented TypeResolver to support advanced PHPDoc types (nullable, arrays, class references).
- Refactored Core and Generator to leverage new components.
- Updated README.md with detailed usage instructions and support for new tags.
- Updated SAFE_BACKLOG.md with progress on Epic 2 and completed features F2.1 and F2.4.
- Added unit tests for TypeResolver and updated existing tests.
- Verified functionality with updated examples.

Co-authored-by: tolawho <12527881+tolawho@users.noreply.github.com>
* feat: advanced type system (generics/inheritance) and OpenAPI 3.1 support

- Implement recursive inheritance and trait property merging
- Add advanced generics support with nested template substitution
- Implement multi-pass AST analysis for better type resolution
- Add OpenAPI 3.1 support with automatic nullable type conversion
- Update SAFe backlog and test coverage

* fix: resolve generic properties correctly and format code to PSR-12 standard

* docs: update

---------

Co-authored-by: tolawho <12527881+tolawho@users.noreply.github.com>
Co-authored-by: TFO-ThanhDV_391 <thanhdv_391@thefirstone.jp>
- Added Yaml::DUMP_NUMERIC_KEY_AS_STRING flag to Generator's YAML export.
- This ensures HTTP status codes (like '200') are treated as strings by Swagger Editor.
- Updated getUsedSchemas to exclude classes that are only used for inheritance (flattened).
- Enabled setFilterUnusedSchemas(true) by default in generate.php.
- This resolves 'Definition was declared but never used' warnings in Swagger Editor.

---------

Co-authored-by: tolawho <12527881+tolawho@users.noreply.github.com>
- Created bin/php-swag executable.
- Implemented GenerateCommand using symfony/console.
- Refactored Generator and Core to support both YAML and JSON outputs.
- Added support for multiple scan paths, output redirection, and OpenAPI version selection via CLI.
- Updated composer.json to include the binary.
- Updated README.md and SAFE_BACKLOG.md.

Co-authored-by: tolawho <12527881+tolawho@users.noreply.github.com>
- Implemented explicit route parameter tags: @path, @query, @Header, @cookie, @Body.
- Implemented Auto-inference from method signatures (primitive types to path/query, class types to body).
- Removed support for legacy @PARAM and @request tags to avoid ambiguity.
- Added support for metadata parsing (enum, default) from PHPDoc descriptions.
- Improved NameResolver to handle FQCN resolution idempotently.
- Updated README and SAFe backlog.
- Added comprehensive unit tests and verified removal of legacy tags.

---------

Co-authored-by: tolawho <12527881+tolawho@users.noreply.github.com>
- Updated SAFE_BACKLOG.md with Epic 4, including Global Info, Security,
  Validation, MIME types, and Operation metadata features.
- Added detailed User Stories for Epic 4.
- Updated SAFE_STRATEGY.md with a Proposed Roadmap for PI 1.

Co-authored-by: tolawho <12527881+tolawho@users.noreply.github.com>
- Add support for global PHPDoc tags: @title, @Version, @description, @host, @contact.*, @license.*
- Implement top-level PHPDoc scanning in Core
- Add duplicate global tag detection with exceptions
- Add CLI overrides for global metadata in GenerateCommand
- Improve Scanner to support individual file paths
- Add unit tests for global metadata discovery and overrides
- Update README.md with new features and instructions
- Add @securityDefinitions.apikey and @securityDefinitions.jwt support in global PHPDocs.
- Add @security support for both global and operation level.
- Support OR/AND combinations and scopes in security requirements.
- Update Generator to include securitySchemes and security objects in OpenAPI spec.
- Add comprehensive test suite for security features.
- Added support for validation tags: minimum, maximum, minLength, maxLength, pattern, format, and example.
- Tags are supported in both Model properties and Route parameters (query, path, etc.).
- Implemented automatic type casting for numeric validation values and default/example values.
- Updated SAFe backlog to reflect feature completion.
- Added comprehensive test suite for validation tags.
* feat: implement performance caching, MIME types, response aliases, and advanced operation metadata

---------

Co-authored-by: TFO-ThanhDV_391 <thanhdv_391@thefirstone.jp>
- document map types, body constraints, and default response codes
- serialize HTTP status code keys as strings and empty security scopes as arrays in YAML
Added Epic 5, corresponding features, and user stories based on the
discussion to enhance the generator's capabilities and developer
experience.
- controller-level metadata and global tag ordering
- enhanced diagnostics & error reporting
- intelligent Schema Inference and update docs
- native PHP Enum support and downgrade PHP requirement to >=8.0
- smart type Mapping Registry for common classes and custom mappings
…ds in both YAML and JSON format

- refactor cli command
- serialize empty object/mapping fields in both YAML and JSON format
…iscovery

This commit performs a complete refactoring of PhpSwag's Core component across 6 distinct phases to improve maintainability, clean code, and SOLID compliance.

Changelog:
1. Dependency Injection:
   - Modified Core's constructor to accept Scanner, Parser, DocBlockCollector, SchemaRegistry, TypeMappingRegistry, Generator, TypeAnalyzer, and GlobalMetadataDiscoverer.
   - Provided Core::createDefault() factory to preserve backward compatibility.
   - Updated external CLI commands and tests to leverage the new factory.

2. Type Analysis Extraction:
   - Created PhpSwag\TypeAnalyzer to encapsulate primitive/DocBlock type checks (nullable, required).

3. Tag Parsing Registry:
   - Designed TagParserInterface and SchemaTagParserInterface for registering custom tag parsers.
   - Created RouteContext and SchemaContext DTOs to encapsulate parsing state.

4. Method Tag Parsers:
   - Created RouteTagParser (@route), ResponseTagParser (@response), ParamTagParser (@path, @query, @Header, @cookie), BodyTagParser (@Body), SecurityTagParser (@security), and BasicMethodTagParser (@summary, @description, etc.).

5. Class & Property Tag Parsers:
   - Created ExtendsTagParser (@extends, @use), ClassMetadataTagParser (@tag, @security, @accept, @consume, @produce, @required), and PropertyTagParser (@Property, @var).

6. Global Metadata Discovery:
   - Isolated token-level comment scanning (token_get_all) into GlobalMetadataDiscoverer.

7. Test Enhancements:
   - Added CoreDependencyInjectionTest, TypeAnalyzerTest, and GlobalMetadataDiscovererTest.
   - Verified clean PSR-12 / PHPStan static analysis and 100% test coverage.
- improve DX with interactive init wizard, structured error diagnostics, and interface scanning
- implement phpswag watch with live preview and configuration integration
@tolawho tolawho self-assigned this Jun 9, 2026
@tolawho
tolawho merged commit 23de25d into main Jun 9, 2026
2 checks passed
@tolawho
tolawho deleted the release/v1.0.1 branch June 9, 2026 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant