Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
vendor/

composer.lock
.phpunit.cache/
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Changelog

All notable changes to this project will be documented in this file.

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

## [Unreleased]

## [1.0.0] - Initial Release

### Added
- Initial extraction of the validation module into the standalone library `maatify/validation`
- Schema-based validation system
- Validation rules
- Validation result DTO
- Error code enums
- Schema abstraction
- Pagination and query validation helpers
14 changes: 7 additions & 7 deletions HOW_TO_USE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This guide explains **how to use the Validation module** in controllers and
application flow.

It assumes:
- The Validation module is available under the project namespace `App\Modules\Validation`
- The Validation module is available under the project namespace `Maatify\Validation`
- `respect/validation` is installed
- PHP 8.2+
- PHPStan level max compatibility is required
Expand All @@ -25,9 +25,9 @@ Example:
### Step 2 — Validate the Input

```php
use App\Modules\Validation\Validator\RespectValidator;
use app\Modules\Validation\Schemas\AuthLoginSchema;
use app\Modules\Validation\ErrorMapper\SystemApiErrorMapper;
use Maatify\Validation\Validator\RespectValidator;
use Maatify\Validation\Schemas\AuthLoginSchema;
use Maatify\Validation\ErrorMapper\SystemApiErrorMapper;

/** @var array<string, mixed> $input */
$input = (array) $request->getParsedBody();
Expand Down Expand Up @@ -82,9 +82,9 @@ if (!$result->isValid()) {
All schemas **must extend `AbstractSchema`**.

```php
use app\Modules\Validation\Schemas\AbstractSchema;
use app\Modules\Validation\Rules\RequiredStringRule;
use app\Modules\Validation\Enum\ValidationErrorCodeEnum;
use Maatify\Validation\Schemas\AbstractSchema;
use Maatify\Validation\Rules\RequiredStringRule;
use Maatify\Validation\Enum\ValidationErrorCodeEnum;

final class ExampleSchema extends AbstractSchema
{
Expand Down
8 changes: 4 additions & 4 deletions HOW_TO_USE_GUARDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ without knowing anything about HTTP, JSON, or Validation internals.
All guard-related denial reasons are expressed using:

```php
App\Validation\Enum\AuthErrorCodeEnum
Maatify\Validation\Enum\AuthErrorCodeEnum
````

Examples:
Expand All @@ -74,7 +74,7 @@ Guards signal denial by throwing a typed exception.
### 📄 Example Exception

```php
use App\Validation\Enum\AuthErrorCodeEnum;
use Maatify\Validation\Enum\AuthErrorCodeEnum;
use RuntimeException;

final class AuthFailedException extends RuntimeException
Expand Down Expand Up @@ -105,7 +105,7 @@ final class AuthFailedException extends RuntimeException
### 📄 Example Guard

```php
use App\Validation\Enum\AuthErrorCodeEnum;
use Maatify\Validation\Enum\AuthErrorCodeEnum;

final class AuthorizationGuard
{
Expand Down Expand Up @@ -135,7 +135,7 @@ Guards are typically executed inside middleware or controller flow.
### 📄 Example Middleware Handler

```php
use App\Validation\ErrorMapper\SystemApiErrorMapper;
use Maatify\Validation\ErrorMapper\SystemApiErrorMapper;

try {
$guard->assertAllowed($permissionGranted);
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ A **type-safe, framework-agnostic input validation module** built on top of
**Respect/Validation**, designed for clean architecture, strict static analysis,
and future extraction as a standalone library.

This module is used inside the Admin Control Panel but is **not coupled** to:
This module is designed for standalone usage and is **not coupled** to:
- Authentication
- Authorization (Guards)
- Domain Logic
Expand Down
17 changes: 17 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Security Policy

## Supported Versions

The latest stable version receives security updates.

| Version | Supported |
| ------- | --------- |
| 1.x | Yes |

## Reporting a Vulnerability

Please do not report security vulnerabilities through public GitHub issues.

Instead, please report them privately by emailing [security@maatify.dev](mailto:security@maatify.dev).

You should receive a response within 48 hours. If for some reason you do not, please follow up via email to ensure we received your original message.