-
Notifications
You must be signed in to change notification settings - Fork 6
Serializer #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Serializer #121
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a secure serialization toolkit for XOOPS/XMF that provides safe serialization/deserialization with multiple format support. The implementation focuses on security by default, explicit format handling, and backward compatibility with legacy data.
- Introduces a comprehensive Serializer class with JSON, PHP, and legacy format support
- Adds format detection and automatic migration capabilities
- Provides debug mode for performance monitoring and migration tracking
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/Security/Serializer.php | Core serializer class with secure deserialization, format detection, and debug capabilities |
| src/Security/Format.php | Format constants for different serialization types |
| src/Security/SerializableTrait.php | Trait for easy integration with existing classes and migration support |
| src/Security/example.md | Documentation and usage examples for the serialization toolkit |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| @@ -0,0 +1,110 @@ | |||
| <?php | |||
Copilot
AI
Oct 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing strict_types declaration. Add declare(strict_types=1); after the opening PHP tag for consistency with other files in the PR.
| <?php | |
| <?php | |
| declare(strict_types=1); |
| // self::validateInput($payload); | ||
| // self::validateSecurity($payload, empty($allowedClasses)); | ||
| // | ||
| // return self::unserialize($payload, $allowedClasses); | ||
|
|
Copilot
AI
Oct 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented-out code. This creates unnecessary clutter and the same logic is implemented below with debug support.
| // self::validateInput($payload); | |
| // self::validateSecurity($payload, empty($allowedClasses)); | |
| // | |
| // return self::unserialize($payload, $allowedClasses); |
| use JsonException; | ||
| use RuntimeException; | ||
| use UnexpectedValueException; |
Copilot
AI
Oct 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unused imports. These exception classes are not used in this constants-only class.
| use JsonException; | |
| use RuntimeException; | |
| use UnexpectedValueException; |
No description provided.