mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 04:04:19 +00:00
Some generic C++ and Rust code is not generated when unions use type aliases because of potential ambiguity. Actually check for this ambiguity and only disable offending code only if it is found.
28 lines
477 B
PHP
28 lines
477 B
PHP
<?php
|
|
// automatically generated by the FlatBuffers compiler, do not modify
|
|
|
|
namespace MyGame\Example;
|
|
|
|
class AnyAmbiguousAliases
|
|
{
|
|
const NONE = 0;
|
|
const M1 = 1;
|
|
const M2 = 2;
|
|
const M3 = 3;
|
|
|
|
private static $names = array(
|
|
"NONE",
|
|
"M1",
|
|
"M2",
|
|
"M3",
|
|
);
|
|
|
|
public static function Name($e)
|
|
{
|
|
if (!isset(self::$names[$e])) {
|
|
throw new \Exception();
|
|
}
|
|
return self::$names[$e];
|
|
}
|
|
}
|