diff --git a/hphp/hack/test/integration/data/simple_repo/.hhconfig b/hphp/hack/test/integration/data/simple_repo/.hhconfig index 2d9e0960491fb8..b3d2769f5a8e7d 100644 --- a/hphp/hack/test/integration/data/simple_repo/.hhconfig +++ b/hphp/hack/test/integration/data/simple_repo/.hhconfig @@ -7,3 +7,6 @@ disallow_fun_and_cls_meth_pseudo_funcs = true auto_namespace_map = {"Herp": "Derp\\Lib\\Herp"} disable_xhp_element_mangling = false + +allowed_files_for_module_declarations = modules.php, modules_ns.php + diff --git a/hphp/hack/test/integration/data/simple_repo/Attribute.php b/hphp/hack/test/integration/data/simple_repo/Attribute.php new file mode 100644 index 00000000000000..0167d368b2371e --- /dev/null +++ b/hphp/hack/test/integration/data/simple_repo/Attribute.php @@ -0,0 +1,4 @@ +> + +module bar; + +internal class CI { + internal int $x = 0; + static internal int $y = 0; +} + +abstract class X { + abstract internal function foo(): CI; +} + +class Y { + internal function foo(): CI { + return new CI(); + } + + public function foobar(): void { + } + + static internal function barfoo(): void { + } +} diff --git a/hphp/hack/test/integration/data/simple_repo/ClassFoo.php b/hphp/hack/test/integration/data/simple_repo/ClassFoo.php new file mode 100644 index 00000000000000..51040fe28a3dab --- /dev/null +++ b/hphp/hack/test/integration/data/simple_repo/ClassFoo.php @@ -0,0 +1,8 @@ +> + +module foo; + +internal class ClassFoo { + +} diff --git a/hphp/hack/test/integration/data/simple_repo/ClassFooNS.php b/hphp/hack/test/integration/data/simple_repo/ClassFooNS.php new file mode 100644 index 00000000000000..ad8013ccfa7a33 --- /dev/null +++ b/hphp/hack/test/integration/data/simple_repo/ClassFooNS.php @@ -0,0 +1,8 @@ +> + +module fooNS; + +class ClassFooNS { + +} diff --git a/hphp/hack/test/integration/data/simple_repo/Members.php b/hphp/hack/test/integration/data/simple_repo/Members.php new file mode 100644 index 00000000000000..eca17f116a5ebe --- /dev/null +++ b/hphp/hack/test/integration/data/simple_repo/Members.php @@ -0,0 +1,28 @@ +> + +module foo; + +newtype N = int; + +internal newtype NI = int; + +trait T { +} + +internal trait TI { +} + +interface I { +} + +internal interface II { +} + +enum E: int { + Red = 3; +} + +internal enum EI: int { + Red = 3; +} diff --git a/hphp/hack/test/integration/data/simple_repo/modules.php b/hphp/hack/test/integration/data/simple_repo/modules.php new file mode 100644 index 00000000000000..3e5e010bbbd300 --- /dev/null +++ b/hphp/hack/test/integration/data/simple_repo/modules.php @@ -0,0 +1,7 @@ +> + + +<> +new module foo {} +new module bar {} diff --git a/hphp/hack/test/integration/data/simple_repo/modules_ns.php b/hphp/hack/test/integration/data/simple_repo/modules_ns.php new file mode 100644 index 00000000000000..f09fbcf60d34a1 --- /dev/null +++ b/hphp/hack/test/integration/data/simple_repo/modules_ns.php @@ -0,0 +1,7 @@ +> + +// namespace don't apply to modules +namespace SomeNS; + +new module fooNS {}