Download the PHP package kariricode/sanitizer without Composer

On this page you can find all versions of the php package kariricode/sanitizer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sanitizer

KaririCode Sanitizer

[![CI](https://github.com/KaririCode-Framework/kariricode-sanitizer/actions/workflows/ci.yml/badge.svg)](https://github.com/KaririCode-Framework/kariricode-sanitizer/actions/workflows/ci.yml) [![PHP 8.4+](https://img.shields.io/badge/PHP-8.4%2B-777BB4?logo=php&logoColor=white)](https://www.php.net/) [![License: MIT](https://img.shields.io/badge/License-MIT-22c55e.svg)](LICENSE) [![PHPStan Level 9](https://img.shields.io/badge/PHPStan-Level%209-4F46E5)](https://phpstan.org/) [![Tests](https://img.shields.io/badge/Tests-175%20passing-22c55e)](https://github.com/KaririCode-Framework/kariricode-sanitizer/actions) [![Coverage](https://img.shields.io/badge/Coverage-100%25-22c55e)](https://github.com/KaririCode-Framework/kariricode-sanitizer/actions) [![Rules](https://img.shields.io/badge/Rules-33-22c55e)](docs/spec/SPEC-002-rule-reference.md) [![ARFA](https://img.shields.io/badge/ARFA-1.43-orange)](https://kariricode.org) [![KaririCode Framework](https://img.shields.io/badge/KaririCode-Framework-orange)](https://kariricode.org) **Composable, rule-based data sanitization engine for PHP 8.4+ — 33 rules, zero dependencies.** [Installation](#installation) · [Quick Start](#quick-start) · [Attribute DTO](#attribute-driven-dto-sanitization) · [All Rules](#all-33-rules) · [Architecture](#architecture) · [Docs](docs/README.md)

The Problem

Raw user input arrives dirty — whitespace, wrong case, dangerous HTML, unformatted documents — and cleaning it is always ad-hoc:

The Solution


Requirements

Requirement Version
PHP 8.4 or higher
kariricode/property-inspector ^2.0

Installation


Quick Start


Attribute-Driven DTO Sanitization


Modification Tracking

Every change is logged with before/after values — full audit trail for free:


XSS Prevention


Brazilian Document Formatting


All 33 Rules

Category Count Aliases
String 12 trim, lower_case, upper_case, capitalize, slug, truncate, normalize_whitespace, normalize_line_endings, pad, replace, regex_replace, strip_non_printable
HTML 5 strip_tags, html_encode, html_decode, html_purify, url_encode
Numeric 4 to_int, to_float, clamp, round
Type 3 to_bool, to_string, to_array
Date 2 normalize_date, timestamp_to_date
Filter 4 digits_only, alpha_only, alphanumeric_only, email_filter
Brazilian 3 format_cpf, format_cnpj, format_cep

See SPEC-002 for full parameter reference.


Rule Parameters


Custom Rules


Ecosystem Position

The Sanitizer cleans data — removes noise while preserving semantic meaning. Key property: idempotency — sanitize(sanitize(x)) = sanitize(x). Contrast with the Transformer, which converts representation and may change type.


Architecture

Source layout

Key design decisions

Decision Rationale ADR
Alias-based rule registry Flat names (trim), no FQCN coupling, custom aliases ADR-001
Property Inspector integration Delegates reflection and caching to kariricode/property-inspector ADR-002
Immutable SanitizationContext Thread safety, no cross-rule parameter pollution ADR-003
ARFA passthrough contract Non-matching types returned unchanged — rules never coerce ADR-004
Zero-dependency rules All 33 rules use only PHP built-ins ADR-005

Specifications

Spec Covers
SPEC-001 Engine contract, sanitize flow, result API
SPEC-002 All 33 rules — aliases, parameters, defaults
SPEC-003 #[Sanitize] attribute shape and DTO flow

Project Stats

Metric Value
PHP source files 51
Source lines ~2,100
Test files 20
Test lines ~1,938
Tests 175 passing
Assertions 425
Coverage 100% (48 classes)
External runtime dependencies 1 (kariricode/property-inspector)
Rule classes 33
Rule categories 7
PHPStan level 9 (0 errors)
Psalm 100% type inference (0 errors)
PHP version 8.4+
ARFA compliance 1.43 V4.0

Contributing


License

Walmir Silva


Part of the **[KaririCode Framework](https://kariricode.org)** ecosystem. [kariricode.org](https://kariricode.org) · [GitHub](https://github.com/KaririCode-Framework/kariricode-sanitizer) · [Packagist](https://packagist.org/packages/kariricode/sanitizer) · [Issues](https://github.com/KaririCode-Framework/kariricode-sanitizer/issues)

All versions of sanitizer with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
kariricode/property-inspector Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kariricode/sanitizer contains the following files

Loading the files please wait ...