Skip to content

Commit 235e13d

Browse files
lexidorjjergus
authored andcommitted
Support disallow_silence (#118)
* Support `disallow_silence` * Enable strict options that introduce test failures
1 parent 294dce6 commit 235e13d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.hhconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ enable_experimental_tc_features=shape_field_check,sealed_classes
99
user_attributes=
1010
disable_primitive_refinement=true
1111
disallow_stringish_magic=true
12+
disallow_silence = true

src/_Private/Filesystem.hack

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ final class Filesystem {
3131
}
3232

3333
public static function readFile(string $path): string {
34-
$data = @\file_get_contents($path);
34+
$error_level = \error_reporting(0);
35+
$data = \file_get_contents($path);
36+
\error_reporting($error_level);
37+
3538
if ($data === false) {
3639
throw new \Exception("Failed to read file `".$path."'.");
3740
}
@@ -40,7 +43,9 @@ final class Filesystem {
4043
}
4144

4245
public static function writeFile(string $path, string $data): void {
43-
$res = @\file_put_contents($path, $data);
46+
$error_level = \error_reporting(0);
47+
$res = \file_put_contents($path, $data);
48+
\error_reporting($error_level);
4449

4550
if ($res === false) {
4651
throw new \Exception("Failed to write file `".$path."'.");

0 commit comments

Comments
 (0)