-
-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not prefix native functions and constants (#280)
The issue reported in #278 is not exact or rather it is the expected behaviour. A case where one will not want that behaviour is for a legitimate internal symbol for which there is two solutions: - Patch Roave\BetterReflection (which is a lot of work and for which #177 is open) - Patch the `Reflector` class to account for common cases Since the first solution is, although more viable, a lot of work and more of a long-term plan, I think the second solution for the meantime is the way to go.
- Loading branch information
Showing
12 changed files
with
376 additions
and
68 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"autoload": { | ||
"files": [ | ||
"src/functions.php" | ||
] | ||
}, | ||
"bin": "main.php" | ||
} |
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,2 @@ | ||
ok | ||
ok |
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,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
$autoload = __DIR__.'/vendor/scoper-autoload.php'; | ||
|
||
if (false === file_exists($autoload)) { | ||
$autoload = __DIR__.'/vendor/autoload.php'; | ||
} | ||
|
||
require_once $autoload; | ||
|
||
echo foo() ? 'ok' : 'ko'; | ||
echo PHP_EOL; | ||
echo bar() ? 'ok' : 'ko'; | ||
echo PHP_EOL; |
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 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
function foo(): bool { | ||
return true; | ||
} | ||
|
||
if (!function_exists('bar')) { | ||
function bar(): bool { | ||
return true; | ||
} | ||
} | ||
|
||
if (function_exists('baz')) { | ||
baz(); | ||
} |
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
Oops, something went wrong.