forked from facebook/hhvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add deprecation warning to fb_autoload_map
Summary: Been documented as deprecated for a while, but new callers come in. Reviewed By: @jdelong Differential Revision: D1720790
- Loading branch information
1 parent
735f05d
commit 166222c
Showing
6 changed files
with
34 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
<?php | ||
|
||
/** | ||
* Deprecated - use HH\autoload_set_paths instead. | ||
*/ | ||
function fb_autoload_map(mixed $map, string $root): bool { | ||
trigger_error( | ||
__FUNCTION__.'(): Use HH\autoload_set_paths() instead.', | ||
E_DEPRECATED | ||
); | ||
return HH\autoload_set_paths($map, $root); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?hh | ||
function autoload_miss($str1, $str2) { | ||
echo "Failure handler called: $str1 $str2\n"; | ||
} | ||
fb_autoload_map( | ||
array( | ||
'class' => array('foo' => 'autoload-enum-hint-2.inc', | ||
'bar' => 'autoload-enum-hint-3.inc', | ||
'baz' => 'autoload-enum-hint-4.inc'), | ||
'constant' => array(), | ||
'function' => array(), | ||
'failure' => 'autoload_miss', | ||
'type' => array(), | ||
), | ||
__DIR__.'/' | ||
); | ||
include 'autoload-enum-hint-1.inc'; |
10 changes: 10 additions & 0 deletions
10
hphp/test/slow/autoload/autoload-enum-hint-deprecated.php.expectf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Deprecated: fb_autoload_map(): Use HH\autoload_set_paths() instead. in %s/test/slow/autoload/autoload-enum-hint-deprecated.php on line 16 | ||
int(12) | ||
|
||
Warning: Argument 1 to foo() must be of type @Foo, string given in %s/test/slow/autoload/autoload-enum-hint-1.inc on line 6 | ||
string(2) "hi" | ||
string(3) "bar" | ||
int(100) | ||
|
||
Warning: Argument 1 to quux() must be of type @Quux, string given in %s/test/slow/autoload/autoload-enum-hint-1.inc on line 19 | ||
string(2) "hi" |
1 change: 1 addition & 0 deletions
1
hphp/test/slow/autoload/autoload-enum-hint-deprecated.php.hphp_opts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--ffile=hphp/test/slow/autoload/autoload-enum-hint-1.inc --ffile=test/slow/autoload/autoload-enum-hint-1.inc --ffile=hphp/test/slow/autoload/autoload-enum-hint-2.inc --ffile=test/slow/autoload/autoload-enum-hint-2.inc --ffile=hphp/test/slow/autoload/autoload-enum-hint-3.inc --ffile=test/slow/autoload/autoload-enum-hint-3.inc --ffile=hphp/test/slow/autoload/autoload-enum-hint-4.inc --ffile=test/slow/autoload/autoload-enum-hint-4.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters