Skip to content

Conversation

@walmir-silva
Copy link
Contributor

No description provided.

walmir-silva and others added 30 commits July 1, 2024 12:45
- Refined and standardized interface definitions across the project
- Applied Single Responsibility Principle (SRP) to ensure each interface has a clear, singular purpose
- Consistent naming conventions were implemented for better readability and maintainability
- Added thorough documentation for each interface, including method descriptions and expected behaviors
- Organized interfaces within appropriate namespaces to prevent naming collisions and maintain a logical structure
- Ensured parameter names in interface methods are consistent with implementing classes
- Avoided including constructors in interfaces to maintain flexibility

These changes enhance the overall clarity, maintainability, and professional quality of the codebase.
- Refactored `Collection` interface for consistency and adherence to best practices.
- Ensured all tests are comprehensive and validate the expected behavior.
- Implemented BinaryHeap class with support for both min-heap and max-heap operations.
  - Methods include: add, poll, peek, size, isEmpty, heapifyUp, heapifyDown, swap, and compare.
- Created unit tests for BinaryHeap class ensuring 100% coverage.
  - Tested all key operations: add, poll, peek, heapifyUp, heapifyDown, swap, and compare.
  - Included edge case tests for min-heap and max-heap scenarios.
- Ensured compliance with type safety and PHP 8.0+ features.
- Added comprehensive documentation and examples for BinaryHeap usage.

This commit enhances the KaririCode Framework by providing a robust, type-safe, and efficient BinaryHeap data structure with extensive unit tests.
- Enhanced the overview and key features sections for clarity and completeness.
- Added detailed descriptions for all implemented data structures:
  - TreeSet
  - ArrayDeque
  - ArrayQueue
  - TreeMap
  - LinkedList
  - BinaryHeap
  - HashMap
- Included complexity analysis and key methods for each data structure.
- Provided usage examples for each data structure to demonstrate functionality.
- Updated installation instructions and requirements.
- Updated acknowledgments and roadmap sections.
- Define the Container interface with methods: `set`, `get`, and `has`.
- Implement unit tests for `set` method to ensure services are registered correctly.
- Add unit tests for `get` method to verify correct retrieval of services by identifier.
- Include unit tests for `has` method to check existence of services in the container.
- Normalize the `@category` comments in the interface documentation for consistency.

These changes establish a foundational contract for dependency injection within the KaririCode project and ensure robust and reliable functionality through comprehensive testing
- Created Configurable interface for managing configuration settings.
- Created Loggable interface to define logging methods for various log levels.
- Created ContextAware interface for managing context information in logs.
- Created FormatterAware interface for handling log formatter settings.
- Created HandlerAware interface for managing log handlers.
- Created ProcessorAware interface for managing log processors.
- Created LoggingManager interface that combines various logging functionalities.
- Created LogFormatter interface for defining log formatters.
- Created LogHandler interface for handling log records.
- Created LogLevel interface for defining log levels.
- Created LogProcessor interface for processing log records before handling.
- Created LogRotator interface for managing log file rotation.

- Added unit tests for each interface to ensure correct functionality:
  - ConfigurableTest: Tests for setConfig and getConfig methods.
  - LoggableTest: Tests for various logging level methods.
  - ContextAwareTest: Tests for withContext and getContext methods.
  - FormatterAwareTest: Tests for setFormatter and getFormatter methods.
  - HandlerAwareTest: Tests for addHandler, pushHandler, popHandler, and getHandlers methods.
  - ProcessorAwareTest: Tests for addProcessor and getProcessors methods.
  - LoggingManagerTest: Comprehensive tests for all LoggingManager methods.
  - LogFormatterTest: Test for the format method.
  - LogHandlerTest: Test for the handle method.
  - LogLevelTest: Test for the getLevel method.
  - LogProcessorTest: Test for the process method.
  - LogRotatorTest: Test for the rotate method.
…onfigurable interfaces

- Revised and enhanced logging interfaces for better consistency and flexibility.
- Implemented new methods to support asynchronous logging.
- Improved documentation of the interfaces to facilitate integration.
- Added unit tests to ensure the robustness of the new implementations.
- Added unit test for LoggerAware interface to verify setLogger method.
- Added unit test for LoggerConfigurable interface to verify configure method.
- Ensured proper mock setup and expectations in tests.
- Removed .phpcs-cache for cleaner repository
- Updated src/Logging/LogHandler.php to enhance log handling capabilities
- Modified src/Logging/LogLevel.php for better log level management
- Enhanced src/Logging/LogRotator.php with improved file rotation logic
- Updated src/Logging/Logger.php to integrate changes in log handling and rotation
- Modified the Indexable.php interface to enhance functionality.
- Updated the LogLevel.php class to add new log levels.
- Made lint adjustments in LogRotator class.
- Introduce new interfaces: Processor, ConfigurableProcessor, Pipeline
- Add comprehensive PHPUnit tests for each interface
- Enhance code documentation with detailed PHP DocBlocks
- Ensure consistency with existing KaririCode coding standards
- Introduced `ProcessorRegistry` interface to standardize processor registration and retrieval across contexts.
- Added `ProcessorRegistryTest` class to ensure correctness of the new interface, covering scenarios like processor registration, retrieval, and error handling.
- Add ProcessorBuilder interface in KaririCode\Contract\Processor namespace
  - Define build() method for constructing individual processors
  - Define buildPipeline() method for assembling processor pipelines

- Create ProcessorBuilderTest class in KaririCode\Contract\Tests\Processor namespace
  - Implement tests for build() and buildPipeline() methods
  - Cover success scenarios and exception handling
  - Ensure proper interaction with ProcessorRegistry
…ate unit tests

- Add PHPDoc comments for ProcessableAttribute interface, including method descriptions and author/license information
- Create unit tests for ProcessableAttribute interface, testing `getProcessors` and `getFallbackValue` methods
…ith unit tests

- Add `Sanitizer` interface for sanitizing input data in `src/Sanitizer/`
- Add `Validator` interface for validating input data in `src/Validator/`
- Add `Serializer` interface for serializing and deserializing data in `src/Serializer/`
- Create unit tests for each interface to ensure expected behavior
- Introduce CustomizableMessageAttribute interface in KaririCode\Contract\Processor\Attribute namespace
- Add method getMessage(string $validatorName): ?string to the interface
- Create unit tests for CustomizableMessageAttribute in CustomizableMessageAttributeTest
- Update existing ProcessableAttribute interface documentation for consistency
walmir-silva and others added 11 commits October 18, 2024 18:07
…rfaces with unit tests

- Added ProcessorValidator interface to define contract for validating processors in a pipeline.
- Added ValidatableProcessor interface to define contract for processors with validation capabilities.
- Created unit tests for ProcessorValidator and ValidatableProcessor to ensure proper validation behavior.
The reset method is added to ensure proper state reset between validations.
This change helps prevent state leakage between multiple validation cycles
by allowing processors to clear their validation state before reuse.

- Add reset() method with proper PHPDoc
- Maintain consistent documentation style
- Keep backward compatibility with existing implementations
The reset method is added to ensure proper state reset between validations.
This change helps prevent state leakage between multiple validation cycles
by allowing processors to clear their validation state before reuse.

- Add reset() method with proper PHPDoc
- Maintain consistent documentation style
- Keep backward compatibility with existing implementations
- Add test cases for all ProcessingResult interface methods
- Include setUp with mock creation
- Validate error handling and data processing
- Ensure proper type declarations
…ate register return in ProcessorRegistry

- Change `register` method in `ProcessorRegistry` interface to return `self` instead of `void` for fluent interface support
- Add professional comments to `BaseProcessorAttribute` abstract class, clarifying property roles and method responsibilities
- Document `filterValidProcessors` and other methods for clearer functionality understanding
@walmir-silva walmir-silva changed the title dd professional comments to BaseProcessorAttribute and update register return in ProcessorRegistry update register return in ProcessorRegistry Oct 26, 2024
@walmir-silva walmir-silva merged commit c6e1e82 into main Oct 26, 2024
1 check passed
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.

2 participants