PHPackages                             shieldfy/sniffer - 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. shieldfy/sniffer

ActiveLibrary

shieldfy/sniffer
================

sniff input types

1.1.3(8y ago)101.5k11MITPHPPHP &gt;=5.6

Since Nov 23Pushed 8y ago7 watchersCompare

[ Source](https://github.com/shieldfy/sniffer)[ Packagist](https://packagist.org/packages/shieldfy/sniffer)[ Docs](https://shieldfy.com)[ RSS](/packages/shieldfy-sniffer/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (5)Dependencies (1)Versions (7)Used By (1)

Shieldfy Sniffer
================

[](#shieldfy-sniffer)

Shieldfy Sniffer is a small composer package to detect the input type , now support 4 types ( integer , string , json , serialize)

[![Packagist](https://camo.githubusercontent.com/fa0c83ef4a1527189a7508a590cd7f903d1c185776822fc20ef2e2f0fb24ef6c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736869656c6466792f736e69666665722e7376673f6c6162656c3d5061636b6167697374267374796c653d666c61742d737175617265)](https://packagist.org/packages/shieldfy/sniffer)[![License](https://camo.githubusercontent.com/28957b7aad447a1df7f0ee394071657ef5b430a8ee82e130855aac5ac452c0bb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f736869656c6466792f736e69666665722e7376673f6c6162656c3d4c6963656e7365267374796c653d666c61742d737175617265)](https://github.com/shieldfy/sniffer/blob/master/LICENSE)[![Code Climate](https://camo.githubusercontent.com/e4bf973724175eb636c314d5a35bf091b7d73c1ed1e62b27b63cd4650c86e6d0/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6769746875622f736869656c6466792f736e69666665722e737667)](https://codeclimate.com/github/shieldfy/sniffer)[![Travis](https://camo.githubusercontent.com/4db7b9061faaf13285e96fadc417aed22fd78e1f8ebf05e6ffff7307a859c25a/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f736869656c6466792f736e69666665722e737667)](https://travis-ci.org/shieldfy/sniffer)

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

[](#installation)

Through Composer

```
composer require shieldfy/sniffer

```

Usage &amp; Examples
--------------------

[](#usage--examples)

```
$type = (new \Shieldfy\Sniffer\Sniffer)->sniff('12.5'); //number

$type = (new \Shieldfy\Sniffer\Sniffer)->sniff('hello world'); //string

$type = (new \Shieldfy\Sniffer\Sniffer)->sniff(json_encode(['hello'=>1,'world'=>'!'])); //json

$type = (new \Shieldfy\Sniffer\Sniffer)->sniff(serialize(['hello'=>1,'world'=>'!'])); //serialize

//you can add more than value as array
$type = (new \Shieldfy\Sniffer\Sniffer)->sniff(['555','abc']);

//test against particular type
$result = (new \Shieldfy\Sniffer\Sniffer)->is('123456789','number'); //true

//you can register your own sniffer on the runtime
$type = (new \Shieldfy\Sniffer\Sniffer)->register('hello',function($input){
	if(strstr($input,'hello'))
		return true;
	return false;
})->sniff('say hello world');
```

### note about serialization

[](#note-about-serialization)

Serialize / Unserialize can be danger due to its ability to convert object and it can be used to preform object injection attack. So explicit sniffing not allowed in php version before php 7 thats because php7 offered new options to prevent object serialization see [here](http://php.net/unserialize)

Contributing
------------

[](#contributing)

Thank you for considering contributing to this project! Bug reports, feature requests, and pull requests are very welcome.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

If you discover a security vulnerability within this project, please send an e-mail to .

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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 ~63 days

Total

5

Last Release

3207d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9817b8aec8f20a77d9b89f64e016bdd9c68eafee34fa70a8d09ffe0f35221768?d=identicon)[shieldfy](/maintainers/shieldfy)

---

Top Contributors

[![netcode](https://avatars.githubusercontent.com/u/286371?v=4)](https://github.com/netcode "netcode (16 commits)")

---

Tags

snifferdetectionshieldfy

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/shieldfy-sniffer/health.svg)

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

###  Alternatives

[cbschuld/browser.php

A PHP Class to detect a user's Browser. This encapsulation provides a breakdown of the browser and the version of the browser using the browser's user-agent string. This is not a guaranteed solution but provides an overall accurate way to detect what browser a user is using.

5876.7M19](/packages/cbschuld-browserphp)[fgribreau/mailchecker

Temporary (disposable/throwaway) email detection library. Covers 1987 fake email providers.

1.9k662.6k4](/packages/fgribreau-mailchecker)[patrickschur/language-detection

A language detection library for PHP. Detects the language from a given text string.

8513.2M18](/packages/patrickschur-language-detection)[doctrine/coding-standard

The Doctrine Coding Standard is a set of PHPCS rules applied to all Doctrine projects.

31914.1M739](/packages/doctrine-coding-standard)[foroco/php-browser-detection

Ultra fast PHP library to detect browser, OS, platform and device type by User-Agent parsing

1554.7M7](/packages/foroco-php-browser-detection)[riverskies/laravel-mobile-detect

Instant mobile detection access directly from within Blade templates.

2361.4M7](/packages/riverskies-laravel-mobile-detect)

PHPackages © 2026

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