memran/marwa-support

Framework-agnostic PHP support library with typed helpers for strings, arrays, files, objects, validation, and security primitives

Maintainers

Package info

github.com/memran/marwa-support

pkg:composer/memran/marwa-support

Statistics

Installs: 189

Dependents: 4

Suggesters: 1

Stars: 0

Open Issues: 0

v1.2.1 2026-03-29 11:30 UTC

This package is auto-updated.

Last update: 2026-03-29 11:31:31 UTC


README

Latest Version Total Downloads License PHP Version CI Coverage PHPStan

Framework-agnostic PHP support utilities for common string, array, file, object, validation, HTML, and security tasks. The package is designed for library and application code that needs small, composable helpers with strict typing and predictable behavior.

Requirements

  • PHP 8.2 or newer
  • Extensions: json, mbstring, openssl

Installation

composer require memran/marwa-support

For local development:

composer install

Usage

use Marwa\Support\Crypt;
use Marwa\Support\File;
use Marwa\Support\Helper;
use Marwa\Support\Str;
use Marwa\Support\Validation;

$slug = Str::slug('Secure Helper Library');
$payload = Crypt::encrypt('secret', $_ENV['APP_KEY']);
File::put(__DIR__ . '/storage/example.json', ['slug' => $slug]);

$validator = Validation::make(
    ['user' => ['email' => 'team@example.com']],
    ['user.email' => 'required|email']
);

if ($validator->fails()) {
    var_dump($validator->errors());
}

$result = Helper::retry(3, fn () => 'ok');

Configuration

The library is mostly configuration-free. Pass secrets such as encryption keys from your application configuration or environment, not from hard-coded strings. For CSRF helpers, call them only in applications that already manage PHP sessions safely.

Testing

composer test
composer test:coverage

Static Analysis

composer analyse
composer lint
composer fix

phpstan.neon.dist runs analysis on src/ at level 5. .php-cs-fixer.dist.php enforces PSR-12-style formatting with strict typing rules.

CI/CD

GitHub Actions runs Composer validation, coding standards, PHPStan, and PHPUnit on PHP 8.2, 8.3, and 8.4 through .github/workflows/ci.yml.

Contributing

  1. Install dependencies with composer install.
  2. Run composer ci before opening a pull request.
  3. Add or update PHPUnit coverage for behavior changes.
  4. Keep commits focused and describe the behavioral impact in the PR.

Repository-specific contributor guidance is available in AGENTS.md.