Skip to content

Releases: Maatify/common

v2.0.0 — Common Scope Cleanup & Architecture Reset

17 Dec 16:05

Choose a tag to compare

🚀 v2.0.0 — Architecture Cleanup

This release introduces a clean architectural reset for maatify/common.

❌ Removed

  • All infrastructure-related contracts:
    • Adapters
    • Repositories
    • Redis / KV interfaces
    • Locking system components
  • Any IO, storage, or driver-level abstractions
  • Legacy v1.x architectural responsibilities

✅ Current Scope

maatify/common is now strictly limited to:

  • Helpers
  • DTOs
  • Traits
  • Enums & constants
  • Validation, sanitization, text, and date utilities

📚 Documentation

  • Documentation rewritten to reflect the new helpers-only scope
  • v1.x documentation archived for historical reference
  • Clear boundary defined between common and infrastructure packages

⚠️ Breaking Change

This is a breaking release.
Projects depending on repository, Redis, KV, or lock-related contracts must migrate to their dedicated packages.


This release establishes a clean, stable foundation for the Maatify ecosystem going forward.

v1.0.10 — Generic KeyValue Storage Contract (Phase 18)

09 Dec 07:08

Choose a tag to compare

This release introduces the KeyValueAdapterInterface, a generic, storage-agnostic key–value behavior contract that cleanly separates business logic from Redis protocol specifics across the Maatify ecosystem.

It completes the architectural split between:

  • Protocol layerRedisClientInterface (Phase 17)
  • Behavior layerKeyValueAdapterInterface (Phase 18)

✨ Highlights

  • ✅ Introduced KeyValueAdapterInterface as the universal KV behavior contract

  • ✅ Decoupled Security Guard and Rate Limiter from Redis-specific APIs

  • ✅ Enabled strict PHPStan max-level typing for all KV-based drivers

  • ✅ Unified behavior across:

    • Redis adapters
    • FakeRedisConnection
    • In-memory KV drivers
  • ✅ Fully backward compatible — no breaking changes


📦 Added

New Contract:

src/Contracts/Adapter/KeyValueAdapterInterface.php

Methods:

  • get(string $key): mixed
  • set(string $key, mixed $value, ?int $ttl = null): void
  • del(string $key): void

🛠 Updated

  • README.md

  • README.full.md

  • CHANGELOG.md

  • roadmap.json

  • VERSION1.0.10

  • Added phase documentation:

    docs/phases/README.phase18.md
    

🧪 Testing & Quality

  • ✅ Security Guard KV behavior verified
  • ✅ Rate Limiter TTL & counters verified
  • ✅ No regressions in Locking System
  • ✅ PHPStan validated at max level
  • ✅ PHPUnit passing with existing test suite

🧭 Ecosystem Impact

This release is now a required foundation for:

  • maatify/security-guard
  • maatify/rate-limiter
  • Upcoming cache, OTP, and session storage systems

It ensures:

  • Clean architecture
  • Driver-agnostic KV storage
  • Deterministic fake vs real driver behavior

v1.0.9 — RedisClientInterface Contract Introduction

26 Nov 09:30

Choose a tag to compare

Added

  • New RedisClientInterface providing a unified KV contract used by
    phpredis, Predis, and FakeRedisAdapter.
  • Standardizes core Redis operations (get/set/del/keys) across
    all Maatify backend libraries.

Notes

  • No breaking changes
  • Fully backward compatible
  • Required for future RedisAdapter modernization in data-adapters

v1.0.8 — Repository Layer Foundation & Unified RepositoryInterface

22 Nov 12:10

Choose a tag to compare

🧾 Release Notes — v1.0.8

⭐ Repository Layer Foundation (Phase 16)

This release introduces the core repository contract for the entire Maatify.dev backend ecosystem.
A new RepositoryInterface has been added to standardize CRUD and pagination operations across all adapters
(MySQL, MongoDB, Redis, DBAL) and prepare the architecture for the upcoming maatify/data-repository package.


🚀 What's New

✔ Added

  • RepositoryInterface defining unified CRUD operations:

    • find(int|string $id): ?array
    • findAll(array $filters = []): array
    • insert(array $data): int|string
    • update(int|string $id, array $data): bool
    • delete(int|string $id): bool
    • paginate(int $page, int $perPage, array $filters = []): PaginationResultDTO
  • New Phase 16 documentation:

    • docs/phases/README.phase16.md
  • Repository section added to:

    • README.md
    • README.full.md

🛠 Updated

  • CHANGELOG.md updated with full v1.0.8 entry
  • VERSION bumped from 1.0.7 → 1.0.8

🔧 Compatibility

  • Fully backward compatible
  • No breaking changes introduced
  • Works with all existing adapters
  • Serves as the base for the upcoming repository layer library (maatify/data-repository)

🧪 Tests

  • All existing tests passed successfully
  • No repository tests added yet (first tests will appear in Phase 17)
  • No behavioral changes to existing modules

📦 Summary

v1.0.8 finalizes the internal architecture for repository operations, enabling clean data access layers, unified patterns, and future repository abstractions across the Maatify backend ecosystem.


v1.0.7 — Redis Simulation Layer & Queue-Lock Stability Enhancements

18 Nov 09:54

Choose a tag to compare

📦 v1.0.7 — Redis Simulation Layer & Deterministic Locking Stability

Release Date: 2025-11-18

Author: Mohamed Abdulalim (megyptm) — Maatify.dev


🧩 Overview

This release introduces a fully simulated Redis environment for internal testing and brings major improvements to the HybridLockManager and queue-mode locking flows.

maatify/common now ships with a robust FakeRedisConnection that behaves like a real Redis server—supporting NX/EX locking, TTL expiration, and atomic delete operations.
This makes the entire locking system more stable, predictable, and testable, especially under concurrent resource scenarios.


✨ Highlights

✔ New Redis Simulation Layer

  • Added FakeRedisConnection:
    A Redis-compatible, in-memory driver supporting:

    • SET with NX + EX
    • TTL expiration
    • Atomic del
    • exists() with real expiration cleanup
  • Used automatically by FakeHealthyAdapter.

✔ Deterministic Queue-Mode Behavior

  • Queue-mode locking now respects TTL timing precisely.
  • Tests verify correct waiting intervals before acquiring the lock.
  • Eliminated microsecond flakiness across PHP versions.

✔ LockManager Improvements

  • HybridLockManager::waitAndAcquire() now fully synchronized with TTL-based expiration.
  • RedisLockManager now uses method-based detection of Redis-like clients instead of strict type checks.

✔ Test Suite Upgrades

  • Updated HybridLockManagerTest for accurate timing tests.
  • Fully deterministic queue-lock behavior.
  • Zero flakiness on PHP 8.4.

🛠 Changes

  • Added Redis simulation layer (FakeRedisConnection)
  • Updated FakeHealthyAdapter with full Redis-like behavior
  • Improved TTL and wait-loop logic in HybridLockManager
  • Adjusted RedisLockManager validation guard for mock compatibility
  • Updated queue-mode timing tests for stability

🧪 Test Results

  • 66 tests
  • 150 assertions
  • ≈ 98% coverage

All tests passed successfully.


✔ Compatibility

  • Full backward compatibility
  • No API changes
  • Safe update for all downstream libraries (data-adapters, rate-limiter, etc.)

🚀 Summary

v1.0.7 strengthens Maatify’s locking infrastructure, stabilizes concurrent execution flows, and introduces true Redis-like behavior for internal tests—without requiring a real Redis server.

This prepares the ecosystem for future distributed-locking enhancements and queue execution features.


v1.0.6 — Flexible Raw Driver Contract (getDriver Refactor)

17 Nov 17:13

Choose a tag to compare

This release introduces a refined raw-driver contract across the common layer.
The getDriver() method now uses a flexible, untyped return signature that
supports returning multiple native driver types (PDO, Doctrine DBAL Connection,
MongoDB Database, Redis, Predis).

This enhancement improves compatibility with maatify/data-adapters and any
future repository layers that expose raw database clients.

Fully backward compatible. No breaking changes.

v1.0.5 — DTO Mutability Update

13 Nov 22:01

Choose a tag to compare

🛠 ConnectionConfigDTO Mutability Update

This release removes the readonly modifier from the ConnectionConfigDTO class.
The change was made to allow more flexible runtime configuration updates,
especially when resolving adapter profiles dynamically inside the Data-Adapters
Resolver and Bootstrap integration layer.

🔄 What’s Updated

  • ConnectionConfigDTO is now fully mutable.
  • Enhanced compatibility with environment-based and dynamic DSN parsing.
  • Improved support for future features such as:
    • Runtime adapter switching
    • Rehydration from cached configuration
    • Dynamic injection from Bootstrap environment loader

⚠️ Notes

This update does not introduce breaking changes for existing users.
All current constructor arguments and usage patterns remain fully compatible.


As always, contributions and issue reports are welcome.

Release 1.0.4 (fix missing VERSION update)

13 Nov 21:25

Choose a tag to compare

Release 1.0.4 (fix missing VERSION update)

v1.0.3 — Connection Config Foundation (Enums + DTO)

13 Nov 14:29

Choose a tag to compare

🚀 maatify/common — v1.0.3

Connection Config Foundation (Enums + DTO)

This release introduces two new core components that will serve as the
foundation for DSN-based routing and multi-profile database configuration
across the entire Maatify ecosystem.

These additions are essential for the upcoming
maatify/data-adapters Phase 10, enabling a unified and extensible
connection-definition layer.


✨ What's New

🔹 1. ConnectionTypeEnum

A standardized enum that represents all supported connection types:

  • mysql
  • mongo
  • redis

This enum guarantees consistent naming and prevents string mismatches across
resolvers, adapters, and bootstrap modules.


🔹 2. ConnectionConfigDTO

A lightweight, immutable Data Transfer Object designed to hold normalized
connection parameters.

Includes:

  • type (ConnectionTypeEnum)
  • dsn (optional)
  • host, port, user, pass, database
  • options (array)
  • profile (optional logical profile name)

This DTO will be used internally by both the bootstrap system and the
data-adapters library to guarantee clean, predictable configuration flow.


📚 Documentation

  • Updated CHANGELOG.md to reflect v1.0.3
  • New Helpers & Configuration section added to README (to be expanded in v1.1)
  • Code comments updated with full PSR-12 compliance

🧪 Testing

  • Enum serialization validated
  • DTO instantiation & immutability tested
  • No breaking changes; 100% backward compatible with v1.0.2

🔗 Part of a Bigger Roadmap

This release is the first required step for maatify/data-adapters v1.1.x,
which introduces full DSN support, string-based routing, and multi-profile
connection resolution.


© 2025 Maatify.dev — Engineered by Mohamed Abdulalim (megyptm)

🚀 Maatify Common v1.0.2 — Introducing TapHelper for Cleaner Initialization

10 Nov 05:31

Choose a tag to compare

🚀 Maatify Common v1.0.2 — Introducing TapHelper for Cleaner Initialization

Release Date: 2025-11-10
Author: [Mohamed Abdulalim (megyptm)](mailto:mohamed@maatify.dev)
License: MIT
Organization: [Maatify.dev](https://www.maatify.dev)


✨ Overview

This version introduces the new TapHelper utility — a lightweight, functional-style helper designed to simplify object initialization and improve code fluency across all Maatify libraries.

It lets you execute a callback on an object or value and return that same instance unchanged, making adapter or service setup much cleaner.

“Cleaner initialization • Consistent patterns • Zero boilerplate.”


🧩 What’s New

  • Added: Maatify\Common\Helpers\TapHelper
    → Provides a static tap() method to execute a callback on a value and return it unchanged.
    → Promotes fluent, functional initialization patterns across the ecosystem.
  • Added Tests: tests/Helpers/TapHelperTest.php
    → Covers object identity, callback execution, and scalar/array support.
  • Updated Docs: README.md
    → New Helper Utilities section with usage examples and architectural notes.
    → Linked reference from the Core Modules section.

🧱 Architectural Impact

  • Enables fluent adapter and service initialization using one line.
  • Improves developer ergonomics and readability throughout Maatify projects.
  • Keeps consistency with helpers such as PathHelper, EnumHelper, and TimeHelper.
  • Fully backward-compatible with v1.0.1 (no breaking changes).

🧾 Changelog Summary

v1.0.2 — 2025-11-10
• Added TapHelper utility under Maatify\Common\Helpers
• Added full unit tests for TapHelper
• Updated README with Helper Utilities section
• Improved developer experience for adapter initialization

📦 Upgrade Guide

No action required.
Simply update via Composer:

composer update maatify/common

All features are non-breaking and immediately available after autoload refresh.


© 2025 Maatify.dev — Engineered by [Mohamed Abdulalim](https://www.maatify.dev)
Distributed under the MIT License