{"id":24722244,"url":"https://github.com/seferov/typhp","last_synced_at":"2025-08-03T09:04:05.071Z","repository":{"id":52415930,"uuid":"215666342","full_name":"seferov/typhp","owner":"seferov","description":"Enforce type declaring for PHP 7.1 and higher","archived":false,"fork":false,"pushed_at":"2021-04-29T20:34:44.000Z","size":266,"stargazers_count":53,"open_issues_count":2,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-02T05:28:54.412Z","etag":null,"topics":["php","php7","strict-types","type-hints"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seferov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-17T00:02:22.000Z","updated_at":"2023-12-24T16:37:36.000Z","dependencies_parsed_at":"2022-08-17T18:05:26.342Z","dependency_job_id":null,"html_url":"https://github.com/seferov/typhp","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seferov%2Ftyphp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seferov%2Ftyphp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seferov%2Ftyphp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seferov%2Ftyphp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seferov","download_url":"https://codeload.github.com/seferov/typhp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235847514,"owners_count":19054537,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","php7","strict-types","type-hints"],"created_at":"2025-01-27T12:17:25.819Z","updated_at":"2025-01-27T12:17:26.623Z","avatar_url":"https://github.com/seferov.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## TYPHP\n\n[![Build Status](https://travis-ci.com/seferov/typhp.svg?branch=master)](https://travis-ci.com/seferov/typhp)\n\n`typhp` is a simple tool checks whether type hint for arguments or return type declared.\nUnlike static analysis tools, it doesn't point out possible errors and issues\nbut suggests typehint everything possible.\n\n#### For whom?\n- Who works projects using PHP 7.1 and higher. \n- Who doesn't want to point out missing type hint and return type declarations in code review process\nby using it as part of CI pipeline.\n- Who love strict typing and defensive programming.\n\n#### Features\n\n- Respects phpdoc; there are some rare cases mixed or compound types are needed.\nIf such cases documented in phpdoc, `typhp` doesn't complain. For example: `@return array|bool`, `@param mixed $foo`, etc.\n- Takes [magic methods](https://www.php.net/manual/en/language.oop5.magic.php) into account.\n- Analyses based on configuration. Include/exclude files and directories to be analysed.\nFor optional config file, see the [current project example](https://github.com/seferov/typhp/blob/master/.typhp.yml)\n- Does NOT modifies your code\n\n## Installation\n\n\nThere are several ways to install `typhp`. The recommended one is to use\nphar distribution. Thus you won't have possible dependency conflict.\n\n#### Phar\n\nDirect download from the [latest Github release](https://github.com/seferov/typhp/releases/latest)\n\n```bash\nwget https://github.com/seferov/typhp/releases/download/v0.2.0/typhp.phar -O typhp\nchmod +x typhp\n```\n\nYou can install phar distribution by [Phive](https://phar.io/)\n\n```bash\nphive install seferov/typhp --global\n```\n\n#### Composer\n\n`typhp` can be installed by [composer](https://getcomposer.org/) globally.\n\n```bash\ncomposer global require seferov/typhp\n```\n\nIf you prefer, you can it add dev dependency to your project.\n\n```bash\ncomposer require require seferov/typhp --dev\n```\n\n## Usage\n\n`\ntyphp analyse path\n`\n\nIf config file (`.typhp.yml`) is present in project root, it can be run\njust by `vendor/bin/typhp`\n\nExample output\n\n![Example](./docs/example.svg)\n\n## Todo\n\n- [x] Analyse closures\n\n- [ ] Check by PHP version. For example, don't suppress `@param object` for \u003e= PHP 7.2\n\n- [ ] Better configuration\n \n- [ ] Check `declare(strict_types=1)` by config\n\n- [x] Phar file\n\n- [ ] Auto deploy phar file to release assets \u0026 add self-update command\n\n- [ ] Github Actions\n\n\n## Issues\n\nSince 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)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseferov%2Ftyphp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseferov%2Ftyphp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseferov%2Ftyphp/lists"}