diff --git a/lib/Filesystem.php b/lib/Filesystem.php index bc2e01ee..b80aac89 100644 --- a/lib/Filesystem.php +++ b/lib/Filesystem.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + final class Filesystem { public static function createTemporaryFile( string $prefix = '', diff --git a/lib/Str.php b/lib/Str.php index cb5775c4..b7567054 100644 --- a/lib/Str.php +++ b/lib/Str.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + final class Str { public static function explode( string $delimiter, diff --git a/lib/StrBuffer.php b/lib/StrBuffer.php index a64a1ad3..202faaef 100644 --- a/lib/StrBuffer.php +++ b/lib/StrBuffer.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + class StrBuffer { private string $str = ''; diff --git a/lib/utils.php b/lib/utils.php index f960b08b..e89fa397 100644 --- a/lib/utils.php +++ b/lib/utils.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + /** * Remove the 'HH\' prefix from typehint strings * and from strings produced by var_export(). diff --git a/src/BaseCodeBuilder.php b/src/BaseCodeBuilder.php index f2e4f1aa..8fb37ee4 100644 --- a/src/BaseCodeBuilder.php +++ b/src/BaseCodeBuilder.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + abstract class BaseCodeBuilder implements ICodeBuilder { const string DELIMITER = "\t"; diff --git a/src/CodegenClass.php b/src/CodegenClass.php index 43d7e272..9ef2c7da 100644 --- a/src/CodegenClass.php +++ b/src/CodegenClass.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + /** * Generate code for a class. Please don't use this class directly; instead use * the function codegen_class. E.g.: diff --git a/src/CodegenClassBase.php b/src/CodegenClassBase.php index 55f2e498..a313c1a1 100644 --- a/src/CodegenClassBase.php +++ b/src/CodegenClassBase.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + /** * Abstract class to generate code for a class or trait. * diff --git a/src/CodegenConstructor.php b/src/CodegenConstructor.php index 43476afc..2fb6184a 100644 --- a/src/CodegenConstructor.php +++ b/src/CodegenConstructor.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + /** * Generate code for a constructor. E.g. * diff --git a/src/CodegenEnum.php b/src/CodegenEnum.php index b5385e90..aaf8ba0b 100644 --- a/src/CodegenEnum.php +++ b/src/CodegenEnum.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + /** * Generate code for an enum. Please don't use this class directly; instead use * the function codegen_enum. E.g.: diff --git a/src/CodegenFile.php b/src/CodegenFile.php index 4ba43820..7bb74e54 100644 --- a/src/CodegenFile.php +++ b/src/CodegenFile.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + enum CodegenFileResult: int { NONE = 0; UPDATE = 1; diff --git a/src/CodegenFunction.php b/src/CodegenFunction.php index 5bbd84d8..2371012b 100644 --- a/src/CodegenFunction.php +++ b/src/CodegenFunction.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + /** * Generate code for a function. Please don't use this class directly; instead * use the function codegen_function. E.g.: diff --git a/src/CodegenFunctionBase.php b/src/CodegenFunctionBase.php index c76477c6..eae43369 100644 --- a/src/CodegenFunctionBase.php +++ b/src/CodegenFunctionBase.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + /** * Base class to generate a function or a method. */ diff --git a/src/CodegenGeneratedFrom.php b/src/CodegenGeneratedFrom.php index 722abf6e..d2b89063 100644 --- a/src/CodegenGeneratedFrom.php +++ b/src/CodegenGeneratedFrom.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + /** * Describes how the code was generated in order to write a comment on * the generated file. diff --git a/src/CodegenImplementsInterface.php b/src/CodegenImplementsInterface.php index f52e37c5..4d9841ac 100644 --- a/src/CodegenImplementsInterface.php +++ b/src/CodegenImplementsInterface.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + /** * Describes an implemented interface, optionally including a comment, like: * diff --git a/src/CodegenInterface.php b/src/CodegenInterface.php index 3a4f45c2..ca960b5b 100644 --- a/src/CodegenInterface.php +++ b/src/CodegenInterface.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + /** * Generate code for an interface. Please don't use this class directly; instead * use the function codegen_interface. E.g.: diff --git a/src/CodegenMemberVar.php b/src/CodegenMemberVar.php index 13963251..9ae07e07 100644 --- a/src/CodegenMemberVar.php +++ b/src/CodegenMemberVar.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + /** * Generate code for a member variable. Please don't use this class directly; * instead use the function codegen_member_var. E.g.: diff --git a/src/CodegenMethod.php b/src/CodegenMethod.php index 33fba5b9..88093b75 100644 --- a/src/CodegenMethod.php +++ b/src/CodegenMethod.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + /** * Generate code for a method. Please don't use this class directly; instead use * the function codegen_method. E.g.: diff --git a/src/CodegenMethodBase.php b/src/CodegenMethodBase.php index a583b97a..9872bab4 100644 --- a/src/CodegenMethodBase.php +++ b/src/CodegenMethodBase.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + /** * Base class to generate a method or a constructor. * See CodegenMethod or CodegenConstructor diff --git a/src/CodegenShape.php b/src/CodegenShape.php index b20d0312..760a730c 100644 --- a/src/CodegenShape.php +++ b/src/CodegenShape.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + /** * Generate code for a shape. Please don't use this class directly; instead use * the function codegen_shape. E.g.: diff --git a/src/CodegenTrait.php b/src/CodegenTrait.php index 3ba0aa88..7b882d88 100644 --- a/src/CodegenTrait.php +++ b/src/CodegenTrait.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + /** * Generate code for a trait. Please don't use this class directly; instead use * the function codegen_trait. E.g.: diff --git a/src/CodegenType.php b/src/CodegenType.php index b833a1da..1f548e88 100644 --- a/src/CodegenType.php +++ b/src/CodegenType.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + /** * Generate code for a type or newtype definition. Please don't use this class * directly; instead use the functions codegen_type or codegen_newtype. E.g.: diff --git a/src/CodegenUsesTrait.php b/src/CodegenUsesTrait.php index 07969c09..6e0f9413 100644 --- a/src/CodegenUsesTrait.php +++ b/src/CodegenUsesTrait.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + /** * Describe an used trait, optionally including a comment, like: * diff --git a/src/CodegenWithVisibility.php b/src/CodegenWithVisibility.php index 0fbc9d19..ef979749 100644 --- a/src/CodegenWithVisibility.php +++ b/src/CodegenWithVisibility.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + enum CodegenPHPMethodVisibility : string as string { V_PUBLIC = 'public'; V_PRIVATE = 'private'; diff --git a/src/HackBuilder.php b/src/HackBuilder.php index 820228c7..13808e1a 100644 --- a/src/HackBuilder.php +++ b/src/HackBuilder.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + /** * Class to facilitate building code. It has methods for some common patterns * used to generate code. It also deals with indentation and new lines. diff --git a/src/HackBuilderKeys.php b/src/HackBuilderKeys.php index 22e4dd0e..bd56bb49 100644 --- a/src/HackBuilderKeys.php +++ b/src/HackBuilderKeys.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + enum HackBuilderKeys : int { // The key will be used literally, which is useful for example when // passing a constant such as MyEnum::Value diff --git a/src/HackBuilderRenderer.php b/src/HackBuilderRenderer.php index 6fd032e5..62826822 100644 --- a/src/HackBuilderRenderer.php +++ b/src/HackBuilderRenderer.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + /** * Use this trait along with an implementation of ICodeBuilderRenderer. */ diff --git a/src/HackBuilderValues.php b/src/HackBuilderValues.php index d04d8642..834b64ed 100644 --- a/src/HackBuilderValues.php +++ b/src/HackBuilderValues.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + enum HackBuilderValues : int { // The value will be used literally, which is useful for example when // passing a constant such as MyEnum::Value diff --git a/src/HackCodegenConfig.php b/src/HackCodegenConfig.php index adede5a2..196b9df2 100644 --- a/src/HackCodegenConfig.php +++ b/src/HackCodegenConfig.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + /** * This class contains the default configuration for Hack code generation. * Please update it to your needs. diff --git a/src/ICodeBuilder.php b/src/ICodeBuilder.php index 88b1f37b..b749f3cd 100644 --- a/src/ICodeBuilder.php +++ b/src/ICodeBuilder.php @@ -8,5 +8,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + interface ICodeBuilder { } diff --git a/src/ICodeBuilderRenderer.php b/src/ICodeBuilderRenderer.php index 3bca87f4..3e31cf60 100644 --- a/src/ICodeBuilderRenderer.php +++ b/src/ICodeBuilderRenderer.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + interface ICodeBuilderRenderer { /** * Appends the code of this class to the builder diff --git a/src/ICodegenFormatter.php b/src/ICodegenFormatter.php index 7872a840..55f164d4 100644 --- a/src/ICodegenFormatter.php +++ b/src/ICodegenFormatter.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + /** * Implement this interface to define a class to format a file after the * code is generated. diff --git a/src/IHackCodegenConfig.php b/src/IHackCodegenConfig.php index 5c97e28b..132a09c9 100644 --- a/src/IHackCodegenConfig.php +++ b/src/IHackCodegenConfig.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + /** * Implement this interface to define a configuration to generate code. * The config will need to be passed to some of the Codegen constructors, diff --git a/src/PartiallyGeneratedCode.php b/src/PartiallyGeneratedCode.php index 0923aece..70b94e85 100644 --- a/src/PartiallyGeneratedCode.php +++ b/src/PartiallyGeneratedCode.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + /** * Manage partially generated code. The main operation is to merge existing * code (that probably has some handwritten code) with generated code. diff --git a/src/PartiallyGeneratedSignedSource.php b/src/PartiallyGeneratedSignedSource.php index eb50cf08..1240a4f5 100644 --- a/src/PartiallyGeneratedSignedSource.php +++ b/src/PartiallyGeneratedSignedSource.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + /** * Similar to SignedSource, but it uses a different header to indicate that the diff --git a/src/SignedSource.php b/src/SignedSource.php index e466e47c..530d1860 100644 --- a/src/SignedSource.php +++ b/src/SignedSource.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + /** * Designate machine-generated code so tools can distinguish it from * human-generated code, and prevent manual edits of machine-generated code by diff --git a/src/SignedSourceBase.php b/src/SignedSourceBase.php index d098936a..9f2609b6 100644 --- a/src/SignedSourceBase.php +++ b/src/SignedSourceBase.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + abstract class SignedSourceBase { const TOKEN ='<>'; diff --git a/test/CodegenBaseTest.php b/test/CodegenBaseTest.php index ef5e55a7..1fc5695d 100644 --- a/test/CodegenBaseTest.php +++ b/test/CodegenBaseTest.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + abstract class CodegenBaseTest { public static function assertTrue( diff --git a/test/CodegenClassTestCase.codegen b/test/CodegenClassTestCase.codegen index 43678dda..e3de12db 100644 --- a/test/CodegenClassTestCase.codegen +++ b/test/CodegenClassTestCase.codegen @@ -8,6 +8,8 @@ class ClassWithGenerics > { } +namespace Facebook/HackCodegen; + !@#$%codegentest:testConstructorWrapperFunc function TestWrapperFunc(string $text, ?bool $hack): TestWrapperFunc { return new TestWrapperFunc($text, $hack); diff --git a/test/CodegenClassTestCase.php b/test/CodegenClassTestCase.php index 5e58afc1..f9e4e57d 100644 --- a/test/CodegenClassTestCase.php +++ b/test/CodegenClassTestCase.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + final class CodegenClassTestCase extends CodegenBaseTest { public function testDocblock() { diff --git a/test/CodegenEnumTestCase.codegen b/test/CodegenEnumTestCase.codegen index 376b6c0a..ff8a59fa 100644 --- a/test/CodegenEnumTestCase.codegen +++ b/test/CodegenEnumTestCase.codegen @@ -8,6 +8,8 @@ enum Demo : string { * This is a different letter */ B = 'b'; +namespace Facebook/HackCodegen; + } !@#$%codegentest:testDocblock diff --git a/test/CodegenEnumTestCase.php b/test/CodegenEnumTestCase.php index 9c2a4b93..be25bc81 100644 --- a/test/CodegenEnumTestCase.php +++ b/test/CodegenEnumTestCase.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + final class CodegenEnumTestCase extends CodegenBaseTest { public function testDocblock() { diff --git a/test/CodegenExpectedFile.php b/test/CodegenExpectedFile.php index 07e6b3f4..2624c392 100644 --- a/test/CodegenExpectedFile.php +++ b/test/CodegenExpectedFile.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + /** * The main purposes of this class are to: * 1) Serialize a Map into a file. diff --git a/test/CodegenFileTestCase.codegen b/test/CodegenFileTestCase.codegen index 700d5143..2bc3ff29 100644 --- a/test/CodegenFileTestCase.codegen +++ b/test/CodegenFileTestCase.codegen @@ -8,6 +8,8 @@ * Completely autogenerated! * * @-generated SignedSource<<38687075d6c73650c6f1db0ddc0289b1>> +namespace Facebook/HackCodegen; + */ class AllAutogenerated { diff --git a/test/CodegenFileTestCase.php b/test/CodegenFileTestCase.php index 74c7a39b..91f5167b 100644 --- a/test/CodegenFileTestCase.php +++ b/test/CodegenFileTestCase.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + final class CodegenFileTestCase extends CodegenBaseTest { diff --git a/test/CodegenFunctionTestCase.codegen b/test/CodegenFunctionTestCase.codegen index 4ddab6cd..30cc654a 100644 --- a/test/CodegenFunctionTestCase.codegen +++ b/test/CodegenFunctionTestCase.codegen @@ -8,6 +8,8 @@ async function genFoo() { * xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx * (Generated from EntTestSchema) */ +namespace Facebook/HackCodegen; + function getName(): string { return $name; } diff --git a/test/CodegenFunctionTestCase.php b/test/CodegenFunctionTestCase.php index 85c6f3d0..abc36f80 100644 --- a/test/CodegenFunctionTestCase.php +++ b/test/CodegenFunctionTestCase.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + final class CodegenFunctionTestCase extends CodegenBaseTest { public function testSimpleGetter() { diff --git a/test/CodegenInterfaceTestCase.codegen b/test/CodegenInterfaceTestCase.codegen index 21680f70..a0e8546f 100644 --- a/test/CodegenInterfaceTestCase.codegen +++ b/test/CodegenInterfaceTestCase.codegen @@ -8,6 +8,8 @@ interface IExtenderOfOne extends // Generated from Foo::Bar() IExtended { +namespace Facebook/HackCodegen; + } !@#$%codegentest:testExtendsInterfaces diff --git a/test/CodegenInterfaceTestCase.php b/test/CodegenInterfaceTestCase.php index 1b56ff35..45ae8588 100644 --- a/test/CodegenInterfaceTestCase.php +++ b/test/CodegenInterfaceTestCase.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + final class CodegenInterfaceTestCase extends CodegenBaseTest { diff --git a/test/CodegenMemberVarTestCase.codegen b/test/CodegenMemberVarTestCase.codegen index e64e3259..5516e21a 100644 --- a/test/CodegenMemberVarTestCase.codegen +++ b/test/CodegenMemberVarTestCase.codegen @@ -8,6 +8,8 @@ private static $languages = array ( !@#$%codegentest:testDocBlock // a comment +namespace Facebook/HackCodegen; + private $thingWithComment; !@#$%codegentest:testPublicStatic diff --git a/test/CodegenMemberVarTestCase.php b/test/CodegenMemberVarTestCase.php index 5b56d117..0f9d3e8f 100644 --- a/test/CodegenMemberVarTestCase.php +++ b/test/CodegenMemberVarTestCase.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + final class CodegenMemberVarTestCase extends CodegenBaseTest { public function testSimple() { diff --git a/test/CodegenMethodTestCase.codegen b/test/CodegenMethodTestCase.codegen index 2ea18b65..261569da 100644 --- a/test/CodegenMethodTestCase.codegen +++ b/test/CodegenMethodTestCase.codegen @@ -8,6 +8,8 @@ public async function genFoo() { !@#$%codegentest:testConstructor public function __construct(string $name) { +namespace Facebook/HackCodegen; + $this->name = $name; } diff --git a/test/CodegenMethodTestCase.php b/test/CodegenMethodTestCase.php index e01501af..cb369e76 100644 --- a/test/CodegenMethodTestCase.php +++ b/test/CodegenMethodTestCase.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + final class CodegenMethodTestCase extends CodegenBaseTest { public function testSimpleGetter() { diff --git a/test/CodegenShapeTestCase.php b/test/CodegenShapeTestCase.php index 80fd512f..98cdb150 100644 --- a/test/CodegenShapeTestCase.php +++ b/test/CodegenShapeTestCase.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + final class CodegenShapeTestCase extends CodegenBaseTest { diff --git a/test/CodegenSimpleTester.php b/test/CodegenSimpleTester.php index e12a3664..52da4b12 100644 --- a/test/CodegenSimpleTester.php +++ b/test/CodegenSimpleTester.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + require_once('CodegenExpectedFile.php'); require_once('CodegenBaseTest.php'); require_once('TestCodegenConfig.php'); diff --git a/test/CodegenTraitTestCase.codegen b/test/CodegenTraitTestCase.codegen index ba25a904..46cde1a4 100644 --- a/test/CodegenTraitTestCase.codegen +++ b/test/CodegenTraitTestCase.codegen @@ -8,6 +8,8 @@ trait DemoInternal { require extends EntSchema; require implements IEntSchemaBase; +namespace Facebook/HackCodegen; + use EntProvisionalMode; // Generated from Whatever::Method() use WhateverTrait; diff --git a/test/CodegenTraitTestCase.php b/test/CodegenTraitTestCase.php index 4b2e0003..d87b3863 100644 --- a/test/CodegenTraitTestCase.php +++ b/test/CodegenTraitTestCase.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + final class CodegenTraitTestCase extends CodegenBaseTest { public function testDocblock() { diff --git a/test/CodegenTypeTestCase.codegen b/test/CodegenTypeTestCase.codegen index 3de4884b..aaf993f3 100644 --- a/test/CodegenTypeTestCase.codegen +++ b/test/CodegenTypeTestCase.codegen @@ -8,6 +8,8 @@ type Point = shape( 'y' => int, ); +namespace Facebook/HackCodegen; + !@#$%codegentest:testType type Point = (int, int); diff --git a/test/CodegenTypeTestCase.php b/test/CodegenTypeTestCase.php index 717921a6..a9795be7 100644 --- a/test/CodegenTypeTestCase.php +++ b/test/CodegenTypeTestCase.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + final class CodegenTypeTestCase extends CodegenBaseTest { diff --git a/test/HackBuilderTestCase.codegen b/test/HackBuilderTestCase.codegen index d9f5c5c4..ae23f2e1 100644 --- a/test/HackBuilderTestCase.codegen +++ b/test/HackBuilderTestCase.codegen @@ -8,6 +8,8 @@ !@#$%codegentest:testAddSmartMultilineCall $foobarbaz_alphabetagama = +namespace Facebook/HackCodegen; + $this->callSomeThingReallyLongNameReallyReallyLongName( $someSmallParameter, $foobarbaz_alphabetagama + $foobarbaz_alphabetagamaa + diff --git a/test/HackBuilderTestCase.php b/test/HackBuilderTestCase.php index 1e557254..770014f6 100644 --- a/test/HackBuilderTestCase.php +++ b/test/HackBuilderTestCase.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + final class HackBuilderTestCase extends CodegenBaseTest { public function testIfBlock() { diff --git a/test/RefactorCodegenTestCase.codegen b/test/RefactorCodegenTestCase.codegen index 4179d23e..c49ec029 100644 --- a/test/RefactorCodegenTestCase.codegen +++ b/test/RefactorCodegenTestCase.codegen @@ -8,6 +8,8 @@ * * @-partially-generated SignedSource<> */ +namespace Facebook/HackCodegen; + class NewClass { diff --git a/test/RefactorCodegenTestCase.php b/test/RefactorCodegenTestCase.php index 02cb90b7..3fe3e03a 100644 --- a/test/RefactorCodegenTestCase.php +++ b/test/RefactorCodegenTestCase.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + final class RefactorCodegenTestCase extends CodegenBaseTest { /** diff --git a/test/TestCodegenConfig.php b/test/TestCodegenConfig.php index 47d4dddb..2ae19e14 100644 --- a/test/TestCodegenConfig.php +++ b/test/TestCodegenConfig.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + final class TestCodegenConfig implements IHackCodegenConfig { <<__Memoize>> diff --git a/test/run_tests.php b/test/run_tests.php index 6b8a9189..59dbbaa8 100644 --- a/test/run_tests.php +++ b/test/run_tests.php @@ -8,6 +8,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +namespace Facebook/HackCodegen; + require_once('vendor/autoload.php'); require_once('CodegenSimpleTester.php'); $success = CodegenSimpleTester::run();