PHPackages                             seferov/typhp - 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. seferov/typhp

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

seferov/typhp
=============

Enforce type declaring

v0.2.0(6y ago)533.3k2[2 PRs](https://github.com/seferov/typhp/pulls)MITPHPPHP ^7.1CI failing

Since Oct 17Pushed 5y ago3 watchersCompare

[ Source](https://github.com/seferov/typhp)[ Packagist](https://packagist.org/packages/seferov/typhp)[ RSS](/packages/seferov-typhp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (10)Versions (7)Used By (0)

TYPHP
-----

[](#typhp)

[![Build Status](https://camo.githubusercontent.com/c7d3a391c6a50072a436fc29c17832706d1063996c68701d9ce16d4197f2b771/68747470733a2f2f7472617669732d63692e636f6d2f73656665726f762f74797068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/seferov/typhp)

`typhp` is a simple tool checks whether type hint for arguments or return type declared. Unlike static analysis tools, it doesn't point out possible errors and issues but suggests typehint everything possible.

#### For whom?

[](#for-whom)

- Who works projects using PHP 7.1 and higher.
- Who doesn't want to point out missing type hint and return type declarations in code review process by using it as part of CI pipeline.
- Who love strict typing and defensive programming.

#### Features

[](#features)

- Respects phpdoc; there are some rare cases mixed or compound types are needed. If such cases documented in phpdoc, `typhp` doesn't complain. For example: `@return array|bool`, `@param mixed $foo`, etc.
- Takes [magic methods](https://www.php.net/manual/en/language.oop5.magic.php) into account.
- Analyses based on configuration. Include/exclude files and directories to be analysed. For optional config file, see the [current project example](https://github.com/seferov/typhp/blob/master/.typhp.yml)
- Does NOT modifies your code

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

[](#installation)

There are several ways to install `typhp`. The recommended one is to use phar distribution. Thus you won't have possible dependency conflict.

#### Phar

[](#phar)

Direct download from the [latest Github release](https://github.com/seferov/typhp/releases/latest)

```
wget https://github.com/seferov/typhp/releases/download/v0.2.0/typhp.phar -O typhp
chmod +x typhp
```

You can install phar distribution by [Phive](https://phar.io/)

```
phive install seferov/typhp --global
```

#### Composer

[](#composer)

`typhp` can be installed by [composer](https://getcomposer.org/) globally.

```
composer global require seferov/typhp
```

If you prefer, you can it add dev dependency to your project.

```
composer require require seferov/typhp --dev
```

Usage
-----

[](#usage)

`typhp analyse path`

If config file (`.typhp.yml`) is present in project root, it can be run just by `vendor/bin/typhp`

Example output

[![Example](./docs/example.svg)](./docs/example.svg)

Todo
----

[](#todo)

- Analyse closures
- Check by PHP version. For example, don't suppress `@param object` for &gt;= PHP 7.2
- Better configuration
- Check `declare(strict_types=1)` by config
- Phar file
- Auto deploy phar file to release assets &amp; add self-update command
- Github Actions

Issues
------

[](#issues)

Since it is a beta release, there might be some issues. If you found one, please submit it [here](https://github.com/seferov/typhp/issues/new)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community10

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

Total

4

Last Release

2398d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/610bd2fde1711e53582ff2e311a6a40c5fbf4056b30930720e3f315fdb39ae06?d=identicon)[ferhad](/maintainers/ferhad)

---

Top Contributors

[![seferov](https://avatars.githubusercontent.com/u/1233843?v=4)](https://github.com/seferov "seferov (14 commits)")

---

Tags

phpphp7strict-typestype-hintstype-hintstrict-typing

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/seferov-typhp/health.svg)

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

###  Alternatives

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)

PHPackages © 2026

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