Skip to content

v0.2.0: Complete InMemory Adapter System

Choose a tag to compare

@iampersistent iampersistent released this 02 Aug 19:46
· 60 commits to main since this release

🎉 EdgeBinder v0.2.0: Complete InMemory Adapter System

This major release introduces a complete InMemory adapter system with factory pattern, professional test structure, and enhanced developer experience while maintaining full backward compatibility.

🏗️ Major Features

Complete InMemory Adapter System

  • InMemoryAdapterFactory - Full extensible adapter pattern implementation
  • Configuration-based creation - EdgeBinder::fromConfiguration(['adapter' => 'inmemory'])
  • Framework integration - Works with Laravel, Symfony, and all PHP frameworks
  • Production-ready - Advanced query support, comprehensive error handling

Professional Test Structure

  • Standard PHPUnit organization - tests/Unit/ and tests/Integration/ directories
  • 222 comprehensive tests - Up from 210 tests with 643 assertions
  • Clean CI/CD pipeline - Zero PHPUnit warnings in GitHub Actions
  • Enhanced coverage - Improved InMemoryAdapter test coverage

Enhanced Documentation

  • Complete llms.txt update - Full InMemory adapter documentation
  • Updated README.md - New test structure, usage examples, framework integration
  • Comprehensive test docs - Added tests/README.md with detailed guidance
  • Usage examples - Multiple EdgeBinder instances, configuration patterns

🔧 Code Quality Improvements

  • PHPStan Level 8 compliance - Zero static analysis errors
  • Consistent namespacing - Moved to Persistence namespace for clarity
  • Better error handling - Improved exception handling and validation
  • 96.84% line coverage - Maintained high test coverage

📊 Statistics

  • Total Tests: 222 (was 210)
  • Total Assertions: 643 (was 597)
  • Unit Tests: 208 tests in tests/Unit/
  • Integration Tests: 14 tests in tests/Integration/
  • Line Coverage: 96.84% maintained
  • Method Coverage: Significantly improved for InMemoryAdapter

🚀 Usage Examples

New Factory Pattern (Recommended)

use EdgeBinder\Registry\AdapterRegistry;
use EdgeBinder\Persistence\InMemory\InMemoryAdapterFactory;

// Register the factory
AdapterRegistry::register(new InMemoryAdapterFactory());

// Create EdgeBinder from configuration
$edgeBinder = EdgeBinder::fromConfiguration(['adapter' => 'inmemory'], $container);

Framework Integration

// Laravel Service Provider
public function register(): void
{
    AdapterRegistry::register(new InMemoryAdapterFactory());
    
    $this->app->singleton(EdgeBinder::class, function ($app) {
        return EdgeBinder::fromConfiguration(['adapter' => 'inmemory'], $app);
    });
}

New Test Commands

# Run all tests
composer test

# Run only unit tests (fast)
vendor/bin/phpunit tests/Unit

# Run only integration tests
vendor/bin/phpunit tests/Integration

# Generate coverage report
composer test-coverage

🔄 Migration Guide

✅ No Breaking Changes - This release is fully backward compatible.

Old way (still works):

$adapter = new InMemoryAdapter();
$edgeBinder = new EdgeBinder($adapter);

New way (recommended):

AdapterRegistry::register(new InMemoryAdapterFactory());
$edgeBinder = EdgeBinder::fromConfiguration(['adapter' => 'inmemory'], $container);

🎯 Framework Compatibility

  • ✅ Laravel - Full service provider integration
  • ✅ Symfony - Bundle and service configuration
  • ✅ Generic PHP - PSR-11 container support
  • ✅ All frameworks - Consistent adapter registration patterns

📁 New File Structure

src/
├── Persistence/InMemory/
│   ├── InMemoryAdapter.php
│   └── InMemoryAdapterFactory.php    # 🆕 New factory
tests/
├── Unit/                             # 🆕 Reorganized
│   ├── Persistence/InMemory/
│   ├── Registry/
│   └── ...
├── Integration/                      # 🆕 Reorganized
│   ├── AdapterRegistryIntegrationTest.php
│   └── EdgeBinderBuilderTest.php
└── README.md                         # 🆕 Test documentation

🏆 What's Next

This release establishes EdgeBinder as a mature, production-ready library with:

  • Professional development practices
  • Comprehensive testing and documentation
  • Framework-agnostic design patterns
  • Extensible adapter architecture

Future releases will focus on additional adapter implementations (Redis, Database, etc.) and advanced features.


Full Changelog: v0.1.0...v0.2.0