https://github.com/fredemmott/hack-error-suppressor
Disable HHVM's automatic calls to the Hack typechecker
https://github.com/fredemmott/hack-error-suppressor
hack hacklang hhvm typechecker
Last synced: 29 days ago
JSON representation
Disable HHVM's automatic calls to the Hack typechecker
- Host: GitHub
- URL: https://github.com/fredemmott/hack-error-suppressor
- Owner: fredemmott
- License: isc
- Archived: true
- Created: 2017-01-23T00:18:28.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-08-17T16:04:32.000Z (over 7 years ago)
- Last Synced: 2025-12-18T22:38:43.950Z (about 2 months ago)
- Topics: hack, hacklang, hhvm, typechecker
- Language: Hack
- Homepage:
- Size: 24.4 KB
- Stars: 2
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
INACTIVE PROJECT
================
THIS PROJECT IS NO LONGER ACTIVE; it is not needed with HHVM 3.25 and later.
Hack Error Suppressor [](https://travis-ci.org/fredemmott/hack-error-suppressor)
=====================
Unless the `hhvm.hack.lang.look_for_typechecker` ini setting is set to false,
by default HHVM will try to run the typechecker when loading any Hack files,
and raise a catchable runtime fatal error.
This is a PHP library that makes it convenient to temporarily disable this
behavior.
When This Is Useful
-------------------
HHVM's behavior is problematic when:
- HHVM can't work out where the project root is - for example, if you're trying
to run Hack code from a composer plugin
- If your Hack code needs to operate on an incomplete project - for example, if
you wish to write Hack code to fetch dependencies
- If your Hack code needs to operate on known-bad projects - for example,
when updating generated code, the code may be inconsistent while your
codegen is in process
When You Shouldn't Use This
---------------------------
It's probably not appropriate if any of these are true:
- it's used outside of a build/install or codegen process
- it's used when *using* generated code
- it's called during normal use of your software, rather than just by
developers
- it's used outside of the CLI
Typechecker errors are real problems with code, and mean that things *are*
broken; ignoring enforcement is only a good idea if you are expecting your code
to be running on a temporarily-broken codebase, and your code fixes it.
Installation
------------
```
$ composer require fredemmott/hack-error-suppressor
```
Usage
-----
You must enable error suppression before any Hack code is loaded.
You can explicitly enable and disable the suppression:
```PHP
enable();
call_some_hack_code();
$it->disable();
```
You can also enable the suppression with a scope:
```PHP