PHPackages                             m6w6/ascertain - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. m6w6/ascertain

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

m6w6/ascertain
==============

Simple validator, not doing much harm

08PHP

Since Oct 22Pushed 12y ago1 watchersCompare

[ Source](https://github.com/m6w6/ascertain)[ Packagist](https://packagist.org/packages/m6w6/ascertain)[ RSS](/packages/m6w6-ascertain/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

ascertain
=========

[](#ascertain)

[![Build Status](https://camo.githubusercontent.com/bc9c9e9f53f38afb3df061ae4fc32b3f320b40338091d5732f623a26d98953f8/68747470733a2f2f7472617669732d63692e6f72672f6d696b652d7068702d6e65742f61736365727461696e2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/mike-php-net/ascertain)

Harmless validation.

```
$user->assert()
	->that("name")
		->isNotNothing("a name is required")
		->isLen(4, "must be at least 4 characters long")
	->that("email")
		->isEmail("is not valid")
	->that("homepage")
		->when($user->hasHomepage())
		->isUrl("seems not to be a valid URL");

# ...

class User implements \ascertain\Testable
{
	use \ascertain\Validator;

	protected $id;
	protected $name;
	protected $email;
	protected $homepage;

	function hasHomepage() {
		return isset($this->homepage);
	}

	function export() {
		return array(
			"name"     => $this->name,
			"email"    => $this->email,
			"homepage" => $this->homepage.
		);
	}
}
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/2aba95ff5669114af00bd2d49612ffab9e4a29312c00062abef657fec7a2f122?d=identicon)[m6w6](/maintainers/m6w6)

---

Top Contributors

[![m6w6](https://avatars.githubusercontent.com/u/1265282?v=4)](https://github.com/m6w6 "m6w6 (13 commits)")

### Embed Badge

![Health badge](/badges/m6w6-ascertain/health.svg)

```
[![Health](https://phpackages.com/badges/m6w6-ascertain/health.svg)](https://phpackages.com/packages/m6w6-ascertain)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
