PHPackages                             ixnode/php-checker - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ixnode/php-checker

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ixnode/php-checker
==================

PHP Checker - A collection of various PHP types check classes.

0.1.9(3y ago)11.1k4MITPHPPHP ^8.0

Since Dec 30Pushed 3y ago1 watchersCompare

[ Source](https://github.com/ixnode/php-checker)[ Packagist](https://packagist.org/packages/ixnode/php-checker)[ RSS](/packages/ixnode-php-checker/feed)WikiDiscussions main Synced today

READMEChangelog (9)Dependencies (8)Versions (11)Used By (4)

PHP Checker
===========

[](#php-checker)

[![Release](https://camo.githubusercontent.com/f7c06c8418b5330ecb0fa6f52ebaa6d2cadebe467ecfbf64f13f66a09ff550d8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f69786e6f64652f7068702d636865636b6572)](https://github.com/ixnode/php-checker/releases)[![PHP](https://camo.githubusercontent.com/1bbf13029689f8044cc3080b0010efacbee3d0ccebdcf17e9538990f0f53a6c8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253545382e302d3737376262332e7376673f6c6f676f3d706870266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d353535353535267374796c653d666c6174)](https://www.php.net/supported-versions.php)[![PHPStan](https://camo.githubusercontent.com/973bd3af16ac962a6eb7191062ceb018266116d863d18ee07b970e1d9b3e3c4f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d4c6576656c2532304d61782d627269676874677265656e2e7376673f7374796c653d666c6174)](https://phpstan.org/user-guide/rule-levels)[![PHPCS](https://camo.githubusercontent.com/ab66c01daa05a9d45a542da43bd296d4f26384943f0ad0fc4c3f6b9916a2b62b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f50485043532d50535231322d627269676874677265656e2e7376673f7374796c653d666c6174)](https://www.php-fig.org/psr/psr-12/)[![LICENSE](https://camo.githubusercontent.com/3116f603093efdf29004758d6b42f4f5512232bba5b4ca9b8da1e5ae17e90026/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f69786e6f64652f7068702d636865636b6572)](https://github.com/ixnode/php-checker/blob/master/LICENSE)

> A collection of various PHP types check classes.

Introduction
------------

[](#introduction)

This package is helpful to validate complex data types like complex arrays and to comply with DocBlock declarations (static code analysis tools like PHPStan or Psalm). Uses and throws exceptions from [ixnode/php-exception](https://github.com/ixnode/php-exception) as a "one-liner". Instead of using the following code:

```
if (!is_array($value)) {
    throw new TypeInvalidException('array', gettype($this->value));
}
```

just use this one:

```
$checkedArray = (new Checker($value))->checkArray();
```

Installation
------------

[](#installation)

```
composer require ixnode/php-checker
```

```
vendor/bin/php-checker -V
```

```
php-checker 0.1.0 (12-30-2022 18:08:35) - Björn Hempel
```

Usage
-----

[](#usage)

### Example 1

[](#example-1)

```
use Ixnode\PhpChecker\Checker;
```

```
$array = (new Checker(.0))->checkFloat();
```

### Example 2

[](#example-2)

```
use Ixnode\PhpChecker\CheckerArray;
```

```
$array = (new CheckerArray([new Checker(123), new Checker(456), new Checker(678)])->checkClass(Checker::class);
```

### Example 3

[](#example-3)

```
use Ixnode\PhpChecker\CheckerClass;
```

```
$array = (new CheckerClass(new Checker(123)))->check(Checker::class);
```

### Example 4

[](#example-4)

```
use Ixnode\PhpChecker\CheckerJson;
```

```
$array = (new CheckerJson('{"1": 1, "2": 2, "3": 3}'))->check();
```

Available checkers
------------------

[](#available-checkers)

### Class `Ixnode\PhpChecker\Checker`

[](#class-ixnodephpcheckerchecker)

Checks general data type specific properties.

MethodExpected inputMethod ParametersOutput value (if passed)Exception`checkArray` (*Alias of* `CheckerArray::check`)`array``null`*Same as input*`TypeInvalidException``checkClass` (*Alias of* `CheckerClass::checkClass`)`ClassName``class-string`*Same as input*`TypeInvalidException`, `ClassInvalidException``checkFloat``float``null`*Same as input*`TypeInvalidException``checkInteger``int``null`*Same as input*`TypeInvalidException``checkIterable``iterable``null`*Same as input*`TypeInvalidException``checkJson` (*Alias of* `CheckerJson::check`)`json-string``null`*Same as input*`TypeInvalidException``checkObject``object``null`*Same as input*`TypeInvalidException``checkStdClass` (*Alias of* `CheckerClass::checkStdClass`)`stdClass``null`*Same as input*`TypeInvalidException``checkString``string``null`*Same as input*`TypeInvalidException``checkStringOrNull``string|null``null`*Same as input*`TypeInvalidException`### Class `Ixnode\PhpChecker\CheckerArray`

[](#class-ixnodephpcheckercheckerarray)

Checks array specific properties.

MethodExpected inputMethod ParametersOutput value (if passed)Exception`check``array``null`*Same as input*`TypeInvalidException``checkArray``array``null` or `array``array``TypeInvalidException``checkAssoziative``array``null`*Same as input*`TypeInvalidException``checkClass``array``class-string`*Same as input*`TypeInvalidException``checkFlat``array``null`*Same as input*`TypeInvalidException``checkSequential``array``null`*Same as input*`TypeInvalidException``checkString``array``null`*Same as input*`TypeInvalidException``checkStringOrNull``array``null`*Same as input*`TypeInvalidException``checkIndex``array``string``mixed` (*index of given*)`TypeInvalidException`, `ArrayKeyNotFoundException``checkIndexArray``array``string``array` (*index of given*)`TypeInvalidException`, `ArrayKeyNotFoundException``checkIndexArrayArray``array``string`, `null` or `array``array` (*index of given*)`TypeInvalidException`, `ArrayKeyNotFoundException``checkIndexArrayAssoziative``array``string``array` (*index of given*)`TypeInvalidException`, `ArrayKeyNotFoundException``checkIndexArrayClass``array``string``array` (*index of given*)`TypeInvalidException`, `ArrayKeyNotFoundException``checkIndexArrayFlat``array``string``array` (*index of given*)`TypeInvalidException`, `ArrayKeyNotFoundException``checkIndexArraySequential``array``string``array` (*index of given*)`TypeInvalidException`, `ArrayKeyNotFoundException``checkIndexArrayString``array``string``array` (*index of given*)`TypeInvalidException`, `ArrayKeyNotFoundException``checkIndexArrayStringOrNull``array``string``array` (*index of given*)`TypeInvalidException`, `ArrayKeyNotFoundException``checkIndexInteger``array``string``int` (*index of given*)`TypeInvalidException`, `ArrayKeyNotFoundException``checkIndexString``array``string``string` (*index of given*)`TypeInvalidException`, `ArrayKeyNotFoundException``checkIndexStringOrNull``array``string``string|null` (*index of given*)`TypeInvalidException`, `ArrayKeyNotFoundException`### Class `Ixnode\PhpChecker\CheckerClass`

[](#class-ixnodephpcheckercheckerclass)

Checks class specific properties.

MethodExpected inputMethod ParametersOutput value (if passed)Exception`checkClass``ClassName``class-string`*Same as input*`TypeInvalidException`, `ClassInvalidException``checkStdClass``stdClass``null`*Same as input*`TypeInvalidException`### Class `Ixnode\PhpChecker\CheckerJson`

[](#class-ixnodephpcheckercheckerjson)

Checks JSON specific properties.

MethodExpected inputMethod ParametersOutput value (if passed)Exception`check``json-string``null`*Same as input*`TypeInvalidException``isJson``json-string``null``bool``null`Development
-----------

[](#development)

```
git clone git@github.com:ixnode/php-checker.git && cd php-checker
```

```
composer install
```

```
composer test
```

License
-------

[](#license)

This tool is licensed under the MIT License - see the [LICENSE](/LICENSE) file for details

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity47

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.

###  Release Activity

Cadence

Every ~19 days

Recently: every ~41 days

Total

10

Last Release

1105d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/29461791?v=4)[ixnode](/maintainers/ixnode)[@ixnode](https://github.com/ixnode)

---

Top Contributors

[![bjoern-hempel](https://avatars.githubusercontent.com/u/5531245?v=4)](https://github.com/bjoern-hempel "bjoern-hempel (19 commits)")

---

Tags

phpchecker

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ixnode-php-checker/health.svg)

```
[![Health](https://phpackages.com/badges/ixnode-php-checker/health.svg)](https://phpackages.com/packages/ixnode-php-checker)
```

###  Alternatives

[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21623.4k](/packages/imanghafoori-laravel-anypass)[nilportugues/php_todo

Looks into the code using a user-defined list of to-do phrases and stops commit if the total amount increased or is above a threshold.

1210.0k](/packages/nilportugues-php-todo)

PHPackages © 2026

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