Skip to content

Commit 7331589

Browse files
committed
Refactor namespace from Helix to PivotPHP across the codebase
- Updated namespaces in MetricsCollector, PerformanceProfiler, QueryLogger, RepositoryFactory, and various test files to reflect the new PivotPHP structure. - Adjusted import statements in tests to align with the new namespace. - Added integration tests for full application lifecycle, middleware, entity operations, pagination, transaction handling, repository factory, health check, and command registration. - Enhanced TestCase with helper methods for creating test users and posts. - Updated composer scripts and README to reflect the transition from HelixPHP to PivotPHP.
1 parent b20e24d commit 7331589

File tree

109 files changed

+897
-806
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+897
-806
lines changed

.php-cs-fixer.cache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"php":"8.4.8","version":"3.80.0:v3.80.0#e49ed46b8f7adcc451d4cd2ed34eaae33372bc60","indent":" ","lineEnding":"\n","rules":{"binary_operator_spaces":{"default":"single_space","operators":{"=>":null}},"blank_line_after_opening_tag":true,"blank_line_between_import_groups":true,"blank_lines_before_namespace":true,"braces_position":{"allow_single_line_anonymous_functions":true,"allow_single_line_empty_anonymous_classes":true},"class_definition":{"single_line":true},"compact_nullable_type_declaration":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_parentheses":{"anonymous_class":false},"no_blank_lines_after_class_opening":true,"no_extra_blank_lines":{"tokens":["curly_brace_block","extra","parenthesis_brace_block","square_brace_block","throw","use"]},"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":true,"ordered_imports":{"imports_order":["class","function","const"],"sort_algorithm":"alpha"},"return_type_declaration":true,"short_scalar_cast":true,"single_import_per_statement":true,"single_space_around_construct":true,"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"unary_operator_spaces":true,"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"control_structure_braces":true,"control_structure_continuation_position":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline"},"no_break_comment":true,"no_closing_tag":true,"no_multiple_statements_per_line":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":true,"single_line_after_imports":true,"spaces_inside_parentheses":true,"statement_indentation":{"stick_comment_to_next_continuous_control_statement":true},"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"blank_line_before_statement":{"statements":["return"]},"combine_consecutive_issets":true,"combine_consecutive_unsets":true,"empty_loop_body":true,"explicit_indirect_variable":true,"explicit_string_variable":true,"fully_qualified_strict_types":{"import_symbols":true},"heredoc_to_nowdoc":true,"method_chaining_indentation":true,"multiline_comment_opening_closing":true,"multiline_whitespace_before_semicolons":{"strategy":"new_line_for_chained_calls"},"no_superfluous_elseif":true,"no_superfluous_phpdoc_tags":{"allow_mixed":true,"remove_inheritdoc":true},"no_unneeded_control_parentheses":true,"no_useless_else":true,"no_useless_return":true,"no_whitespace_before_comma_in_array":true,"operator_linebreak":true,"ordered_types":true,"php_unit_data_provider_method_order":true,"php_unit_internal_class":true,"php_unit_test_class_requires_covers":true,"phpdoc_add_missing_param_annotation":true,"phpdoc_no_empty_return":true,"phpdoc_order_by_value":true,"phpdoc_types_order":true,"phpdoc_var_annotation_correct_order":true,"protected_to_private":true,"return_assignment":true,"self_static_accessor":true,"single_line_comment_style":{"comment_types":["hash"]},"single_line_empty_body":true,"string_implicit_backslashes":true,"trailing_comma_in_multiline":{"elements":["arrays"]},"whitespace_after_comma_in_array":true,"array_indentation":true,"array_syntax":{"syntax":"short"},"cast_spaces":true,"concat_space":{"spacing":"one"},"align_multiline_comment":true,"backtick_to_shell_exec":true,"class_attributes_separation":{"elements":{"method":"one","property":"one"}},"class_reference_name_casing":true,"clean_namespace":true,"declare_parentheses":true,"echo_tag_syntax":true,"empty_loop_condition":true,"general_phpdoc_tag_rename":{"replacements":{"inheritDocs":"inheritDoc"}},"global_namespace_import":{"import_classes":false,"import_constants":false,"import_functions":false},"include":true,"increment_style":{"style":"post"},"integer_literal_case":true,"lambda_not_used_import":true,"linebreak_after_opening_tag":true,"magic_constant_casing":true,"magic_method_casing":true,"native_function_casing":true,"native_type_declaration_casing":true,"no_alias_language_construct_call":true,"no_alternative_syntax":true,"no_binary_string":true,"no_blank_lines_after_phpdoc":true,"no_empty_comment":true,"no_empty_phpdoc":true,"no_empty_statement":true,"no_leading_namespace_whitespace":true,"no_mixed_echo_print":{"use":"echo"},"no_multiline_whitespace_around_double_arrow":true,"no_null_property_initialization":true,"no_short_bool_cast":true,"no_singleline_whitespace_before_semicolons":true,"no_spaces_around_offset":true,"no_trailing_comma_in_singleline":true,"no_unneeded_braces":{"namespaces":true},"no_unneeded_import_alias":true,"no_unset_cast":true,"no_unused_imports":true,"no_useless_concat_operator":true,"no_useless_nullsafe_operator":true,"normalize_index_brace":true,"nullable_type_declaration":true,"nullable_type_declaration_for_default_null_value":true,"object_operator_without_whitespace":true,"php_unit_fqcn_annotation":true,"php_unit_method_casing":true,"phpdoc_align":true,"phpdoc_annotation_without_dot":true,"phpdoc_indent":true,"phpdoc_inline_tag_normalizer":true,"phpdoc_no_access":true,"phpdoc_no_alias_tag":true,"phpdoc_no_package":true,"phpdoc_no_useless_inheritdoc":true,"phpdoc_order":{"order":["param","return","throws"]},"phpdoc_return_self_reference":true,"phpdoc_scalar":true,"phpdoc_separation":true,"phpdoc_single_line_var_spacing":true,"phpdoc_summary":true,"phpdoc_tag_type":{"tags":{"inheritDoc":"inline"}},"phpdoc_to_comment":true,"phpdoc_trim":true,"phpdoc_trim_consecutive_blank_line_separation":true,"phpdoc_types":true,"phpdoc_var_without_name":true,"semicolon_after_instruction":true,"simple_to_complex_string_variable":true,"single_line_comment_spacing":true,"single_quote":true,"space_after_semicolon":true,"standardize_increment":true,"standardize_not_equals":true,"switch_continue_to_break":true,"trim_array_spaces":true,"type_declaration_spaces":true,"types_spaces":true,"yoda_style":true,"function_typehint_space":true,"new_with_braces":true,"no_trailing_comma_in_list_call":true,"no_trailing_comma_in_singleline_array":true,"self_accessor":true,"simplified_null_return":true},"hashes":{"src\/Http\/CycleRequest.php":"d61806ca6efca3afdb064249f279ff77","src\/Monitoring\/PerformanceProfiler.php":"4c1e039d02da2c519996139444dd81a5","src\/Monitoring\/QueryLogger.php":"866051e7dfb4a57b048c6df1cbd9ea3d","src\/Monitoring\/MetricsCollector.php":"2997e8f21098b1642b617ac5e1f07b6a","src\/Health\/CycleHealthCheck.php":"45602bfd939d6238d37cca487731ed09","src\/Health\/HealthCheckMiddleware.php":"51a441f0ff000b04996adf3380667dc0","src\/CycleServiceProvider.php":"bd7d96497ba0ba179b702eb3313a770f","src\/Exceptions\/CycleException.php":"d5fde34e57486991f306f0d1220d5a1c","src\/Exceptions\/EntityNotFoundException.php":"2909274150e5981e377cf7a073867f97","src\/Exceptions\/CycleORMException.php":"8005db967ba33160ae79cb78cf15cd22","src\/RepositoryFactory.php":"7d501db706eccb285317dc9869b9a01f","src\/Helpers\/CycleHelpers.php":"7c3ea84a16649cb2c863ec28218e9130","src\/Helpers\/app_path.php":"1f7a2e7d65e3dfba56a970c0416d7943","src\/Helpers\/config.php":"ac722a6526ae43990372c7f965509a74","src\/Helpers\/EnvironmentHelper.php":"72177e9474eeef6430b030ba620a78b9","src\/Helpers\/env.php":"defe8ad233122c33e67b9e2e170cbf45","src\/Helpers\/cycle.php":"e735c89ef976fe2d63e46da763c43ede","src\/Middleware\/TransactionMiddleware.php":"65daefaae7cf087f0b0964818193fb07","src\/Middleware\/EntityValidationMiddleware.php":"ca63e794d725e123289ccbea2d9b22f3","src\/Middleware\/CycleMiddleware.php":"0f5811b083460241fe8586d8b18fdd63","src\/Commands\/CommandRegistry.php":"06e5e8e8d50106b1f27354622399a090","src\/Commands\/BaseCommand.php":"7465b4b8f4de0f3c52aa34788d19b6b9","src\/Commands\/CommandNotFoundException.php":"9ca1b96f3cae7179c6a45f383d553967","src\/Commands\/EntityCommand.php":"6ce9405884f196685d5643dbe7321a80","src\/Commands\/StatusCommand.php":"e58804ba6dc1e0ca84887a7717bd4a96","src\/Commands\/MigrateCommand.php":"1ca06e1f0f9f697656f6c14c22f83c65","src\/Commands\/SchemaCommand.php":"2e893f38a13c0f311760dacc45047efb","tests\/Mocks\/MockApplication.php":"df13a41372151ad45c4482fb83105309","tests\/Mocks\/MockContainer.php":"21f565b4d2885df754d5dd3853bca30a","tests\/Mocks\/SimpleTestApp.php":"1ebe203af2a2f613337832ba31c5f4c1","tests\/Entities\/User.php":"6af4fa732cc63bf0e24683fe86859ac4","tests\/Entities\/Post.php":"844e7b455ec67e478888ef4544510927","tests\/Support\/TestApplication.php":"77a0e67dc5d98e730055d19118844ceb","tests\/Database\/DatabaseOperationsTest.php":"44529f74f6a693546f1a7d24c720c93a","tests\/Unit\/CycleServiceProviderUnitTest.php":"25adc1580131dd9bd553c46c5f5697af","tests\/Unit\/MonitoringUnitTest.php":"bece2c3a0f358cd7ab8651fdaa7ad0cb","tests\/Unit\/RepositoryFactoryUnitTest.php":"f15388de479d3a9d969bbd019d7181d1","tests\/TestCase.php":"0229b46fe55385b7f357308ae20b5d7f","tests\/Feature\/RepositoryFactoryTest.php":"22160cf61252d21486fb012147359dad","tests\/Feature\/CycleRequestTest.php":"0e733c5a9c694ad959c7a2d681ef3980","tests\/Feature\/MonitoringTest.php":"7df80c5c37f232af9a3c178ccbb2e0ec","tests\/Integration\/HelixIntegrationTest.php":"53da0417cd78f01777376c6b83239eec"}}

CHANGELOG.md

Lines changed: 101 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,112 @@
11
# Changelog
22

3-
## [1.0.0] - 2025-07-06
4-
5-
### Changed
6-
- Migrated from Express PHP to HelixPHP framework
7-
- Updated all namespaces from `Express\` to `Helix\`
8-
- Renamed package from `cafernandes/express-php-cycle-orm` to `helixphp/cycle-orm`
9-
- Updated documentation structure and fixed typos
10-
- Improved PSR-12 compliance and code quality
11-
12-
### Fixed
13-
- Fixed directory name typo: `techinical``technical`
14-
- Fixed all namespace references in documentation
15-
- Updated version references to v1.0.0
16-
17-
18-
All notable changes to HelixPHP Cycle ORM will be documented in this file.
3+
All notable changes to PivotPHP Cycle ORM will be documented in this file.
194

205
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
216
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
227

23-
## [1.0.0] - 2024-01-07
24-
25-
### 🎉 Initial Release of HelixPHP Cycle ORM
26-
27-
First stable release of HelixPHP Cycle ORM integration, marking the rebrand from the previous namespace to HelixPHP.
28-
29-
### Added
30-
31-
#### Core Integration
32-
- Complete Cycle ORM integration with HelixPHP Core
33-
- CycleServiceProvider for seamless setup
34-
- CycleRequest class extending HelixPHP Request with ORM capabilities
35-
- Repository factory with type-safe implementations
36-
- Entity manager integration for persistence
37-
38-
#### Middleware Suite
39-
- **TransactionMiddleware**: Automatic transaction wrapping for routes
40-
- **EntityValidationMiddleware**: Request validation against entity rules
41-
- **HealthCheckMiddleware**: Database health monitoring
42-
- **CycleMiddleware**: Core middleware for ORM integration
43-
44-
#### Monitoring & Performance
45-
- **QueryLogger**: Track and analyze database queries
46-
- **PerformanceProfiler**: Profile database operations
47-
- **MetricsCollector**: Gather performance statistics
48-
- **CycleHealthCheck**: Monitor database connection health
49-
50-
#### CLI Commands
51-
- `cycle:entity` - Generate entity classes
52-
- `cycle:migrate` - Run database migrations
53-
- `cycle:schema` - Update database schema
54-
- `cycle:status` - Check database status
55-
56-
#### Developer Experience
57-
- Zero-configuration setup with sensible defaults
58-
- Type-safe repository pattern
59-
- Comprehensive helper functions
60-
- Integration with HelixPHP's validation system
61-
62-
### Changed
63-
- **Namespace Migration**: Changed from CAFernandes\ExpressPHP to Helix\CycleORM
64-
- **Package Name**: Now `helixphp/cycle-orm`
65-
- **Dependencies**: Updated to use `helixphp/core` instead of `cafernandes/express-php`
66-
- **PHP Version**: Requires PHP 8.1+
67-
68-
### Testing
69-
- 67 comprehensive tests covering all features
70-
- Unit, feature, and integration test suites
71-
- Mock implementations for testing
72-
- Test helpers and utilities
73-
74-
### Documentation
8+
## [1.0.0] - 2025-07-07
9+
10+
### 🎉 **Initial Stable Release**
11+
12+
First stable release of PivotPHP Cycle ORM integration, providing robust database ORM capabilities for the PivotPHP Framework.
13+
14+
#### Added
15+
- **Cycle ORM Integration**: Complete integration with Cycle ORM for PivotPHP Framework
16+
- **Service Provider**: `CycleServiceProvider` for seamless framework integration
17+
- **Repository Pattern**: Built-in repository pattern support with custom repositories
18+
- **Transaction Middleware**: Automatic transaction handling for requests
19+
- **Entity Validation**: Middleware for entity validation with custom rules
20+
- **Query Monitoring**: Performance monitoring and query logging capabilities
21+
- **Health Checks**: Database health monitoring integration
22+
- **Migration Support**: Schema migration tools and commands
23+
- **Database Factory**: Support for multiple database connections
24+
- **Type Safety**: Full type safety with PHPStan Level 9 compliance
25+
26+
#### Features
27+
- **Multiple Databases**: Support for MySQL, PostgreSQL, SQLite, SQL Server
28+
- **Relationships**: Full support for all Cycle ORM relationship types
29+
- **Migrations**: Schema versioning and migration system
30+
- **Factories**: Entity factories for testing and seeding
31+
- **Events**: Database events and listeners
32+
- **Caching**: Query result caching integration
33+
- **Debugging**: Query debugging and profiling tools
34+
- **Commands**: CLI commands for database operations
35+
36+
#### Technical Details
37+
- **Namespace**: `PivotPHP\CycleORM`
38+
- **Framework**: PivotPHP Core v1.0.0+
39+
- **Cycle ORM**: v2.x compatibility
40+
- **PHP**: 8.1+ with full 8.4 compatibility
41+
- **Standards**: PSR-11, PSR-12 compliant
42+
- **Testing**: Comprehensive test coverage
43+
44+
#### Performance
45+
- **Optimized Queries**: Query optimization and caching
46+
- **Connection Pooling**: Efficient database connection management
47+
- **Lazy Loading**: Intelligent lazy loading of relationships
48+
- **Memory Management**: Optimized memory usage for large datasets
49+
50+
#### Documentation
7551
- Complete integration guide
76-
- Quick reference documentation
77-
- Example implementations
78-
- Migration guide from previous versions
52+
- API reference documentation
53+
- Performance optimization guide
54+
- Migration from other ORMs
55+
- Best practices and examples
7956

80-
### Quality
81-
- PHPStan Level 9 compliance
82-
- PSR-12 code style
83-
- Comprehensive type coverage
84-
- Performance optimized
57+
#### CLI Commands
58+
```bash
59+
php vendor/bin/pivotphp cycle:entity User # Create entity
60+
php vendor/bin/pivotphp cycle:migrate # Run migrations
61+
php vendor/bin/pivotphp cycle:schema # Update schema
62+
php vendor/bin/pivotphp cycle:status # Check status
63+
```
64+
65+
#### Basic Usage
66+
```php
67+
use PivotPHP\Core\Core\Application;
68+
use PivotPHP\CycleORM\CycleServiceProvider;
69+
70+
$app = new Application();
71+
$app->register(new CycleServiceProvider());
72+
73+
// Use in routes
74+
$app->get('/users', function (CycleRequest $request) {
75+
$users = $request->getRepository(User::class)->findAll();
76+
return $request->response()->json($users);
77+
});
78+
```
79+
80+
### 📋 Release Notes
81+
82+
This initial release provides a complete Cycle ORM integration for PivotPHP Framework, offering:
83+
84+
1. **Database Abstraction**: Work with multiple database systems
85+
2. **Type Safety**: Full type safety and static analysis support
86+
3. **Performance**: Optimized for high-performance applications
87+
4. **Developer Experience**: Rich CLI tools and debugging capabilities
88+
5. **Testing**: Comprehensive test coverage and factories
89+
90+
### 🔄 Future Roadmap
91+
92+
Future releases will focus on:
93+
- Additional database drivers
94+
- Enhanced performance optimizations
95+
- Advanced caching strategies
96+
- Extended CLI tooling
97+
- Community-requested features
98+
99+
### 📞 Support
100+
101+
For questions, issues, or contributions:
102+
- **GitHub**: [https://github.com/PivotPHP/pivotphp-cycle-orm](https://github.com/PivotPHP/pivotphp-cycle-orm)
103+
- **Documentation**: [docs/](docs/)
104+
- **Integration Guide**: [docs/integration-guide.md](docs/integration-guide.md)
105+
- **Examples**: [examples/](examples/)
85106

86107
---
87108

88-
## Previous History
89-
90-
### [1.1.0] - Previous Namespace
91-
- Added complete integration guide
92-
- PHP 8.4 compatibility updates
93-
- PSR-12 compliance improvements
94-
- CRUD examples
95-
96-
### [1.0.0] - Previous Namespace
97-
- Initial release under previous namespace
98-
- Basic Cycle ORM integration
99-
- Core middleware implementation
109+
**Current Version**: v1.0.0
110+
**Release Date**: July 7, 2025
111+
**Stability**: Stable
112+
**Framework Requirement**: PivotPHP Core v1.0.0+

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Contribuindo com o HelixPHP Cycle ORM Extension
1+
# Contribuindo com o PivotPHP Cycle ORM Extension
22

33
Obrigado por considerar contribuir com este projeto!
44

CYCLE_ORM_UPDATE_STATUS.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# HelixPHP Cycle ORM Update Status - v1.0.0
1+
# PivotPHP Cycle ORM Update Status - v1.0.0
22

33
## ✅ Updates Applied
44

5-
All files have been updated to reflect the HelixPHP branding:
5+
All files have been updated to reflect the PivotPHP branding:
66

77
### Framework References
8-
- Updated from "Express PHP" to "HelixPHP"
9-
- Updated from "Express-PHP" to "HelixPHP"
10-
- Updated namespace references from `Express\` to `Helix\`
8+
- Updated from "Express PHP" to "PivotPHP"
9+
- Updated from "PivotPHP" to "PivotPHP"
10+
- Updated namespace references from `PivotPHP\Core\` to `Helix\`
1111

1212
### Documentation Structure
1313
- Fixed typo: "techinical" → "technical"
@@ -19,9 +19,9 @@ All files have been updated to reflect the HelixPHP branding:
1919
- Updated README and CHANGELOG
2020

2121
### Package Information
22-
- ✅ Package name: `helixphp/cycle-orm`
22+
- ✅ Package name: `pivotphp/cycle-orm`
2323
- ✅ Namespace: `Helix\CycleORM\`
24-
- ✅ Framework dependency: `helixphp/core`
24+
- ✅ Framework dependency: `pivotphp/core`
2525

2626
### Files Updated
2727
- ✅ Documentation (docs/)

PACKAGIST_MIGRATION_REPORT.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# HelixPHP Cycle ORM - Packagist Migration Report
1+
# PivotPHP Cycle ORM - Packagist Migration Report
22

33
## ✅ Migration Successful!
44

55
### 📊 Summary
66

7-
The `helixphp/cycle-orm` package has been successfully updated to use the published version of `helixphp/core` from Packagist instead of a local path dependency.
7+
The `pivotphp/cycle-orm` package has been successfully updated to use the published version of `pivotphp/core` from Packagist instead of a local path dependency.
88

99
### 🔧 Changes Made
1010

@@ -13,13 +13,13 @@ The `helixphp/cycle-orm` package has been successfully updated to use the publis
1313
- "repositories": [
1414
- {
1515
- "type": "path",
16-
- "url": "../helixphp-core"
16+
- "url": "../pivotphp-core"
1717
- }
1818
- ],
1919
"require": {
2020
"php": "^8.1",
21-
- "helixphp/core": "@dev",
22-
+ "helixphp/core": "^1.0",
21+
- "pivotphp/core": "@dev",
22+
+ "pivotphp/core": "^1.0",
2323
"cycle/orm": "^2.10",
2424
...
2525
},
@@ -37,7 +37,7 @@ Status: ✅ ALL TESTS PASSING
3737

3838
### 📦 Dependencies Installed
3939

40-
- **helixphp/core**: v1.0.0 (from Packagist)
40+
- **pivotphp/core**: v1.0.0 (from Packagist)
4141
- **cycle/orm**: v2.10.1
4242
- **All other dependencies**: Successfully resolved
4343

@@ -73,7 +73,7 @@ composer update
7373
### ✅ Ready for Publication
7474

7575
The package is now ready to be:
76-
1. Published to Packagist as `helixphp/cycle-orm`
76+
1. Published to Packagist as `pivotphp/cycle-orm`
7777
2. Used in production environments
7878
3. Integrated into CI/CD pipelines
7979
4. Installed by end users without issues
@@ -87,6 +87,6 @@ The package is now ready to be:
8787

8888
---
8989

90-
**Date**: $(date)
91-
**Package**: helixphp/cycle-orm
92-
**Status**: ✅ Ready for Packagist Publication
90+
**Date**: $(date)
91+
**Package**: pivotphp/cycle-orm
92+
**Status**: ✅ Ready for Packagist Publication

0 commit comments

Comments
 (0)