File tree 9 files changed +11
-12
lines changed
9 files changed +11
-12
lines changed Original file line number Diff line number Diff line change 17
17
* that will allow to read the data from a database and store it
18
18
* in the object.
19
19
*/
20
- class CodegenDorm {
20
+ final class CodegenDorm {
21
21
22
22
private ICodegenFactory $codegen ;
23
23
Original file line number Diff line number Diff line change 16
16
* For a given DormSchema, this class generates code for a class
17
17
* that will allow to insert rows in a database.
18
18
*/
19
- class CodegenMutator {
19
+ final class CodegenMutator {
20
20
21
21
private HackCodegenFactory $codegen ;
22
22
@@ -211,7 +211,7 @@ private function getCheckRequiredFieldsMethod(): CodegenMethod {
211
211
-> closeStatement()
212
212
-> addAssignment(
213
213
' $missing' ,
214
- ' $required->removeAll($this->data->keys()); ' ,
214
+ ' $required->removeAll($this->data->keys())' ,
215
215
HackBuilderValues :: literal(),
216
216
)
217
217
-> addMultilineCall(
Original file line number Diff line number Diff line change 10
10
11
11
namespace Facebook\HackCodegen ;
12
12
13
- class DormField {
13
+ final class DormField {
14
14
private bool $optional = false ;
15
15
private bool $manual = false ;
16
16
Original file line number Diff line number Diff line change 6
6
* To re-generate this file run codegen.php DormUserSchema
7
7
*
8
8
*
9
- * @partially-generated SignedSource<<cfcc245af5ac1dc449999b80c6e0ecef >>
9
+ * @partially-generated SignedSource<<9a620c7d596d01640d6d302a4bdfae46 >>
10
10
*/
11
11
12
12
final class DormUserMutator {
@@ -59,7 +59,7 @@ public function checkRequiredFields(): void {
59
59
' last_name' ,
60
60
' is_active' ,
61
61
};
62
- $missing = $required -> removeAll($this -> data -> keys());;
62
+ $missing = $required -> removeAll($this -> data -> keys());
63
63
invariant (
64
64
$missing -> isEmpty(),
65
65
' The following required fields are missing: %s' ,
Original file line number Diff line number Diff line change 10
10
11
11
namespace Facebook\HackCodegen ;
12
12
13
- class DormUserSchema implements DormSchema {
13
+ final class DormUserSchema implements DormSchema {
14
14
public function getFields (): Map <string , DormField > {
15
15
return Map {
16
16
' FirstName' => string_field (' first_name' ),
Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ enum CodegenFileResult: int {
17
17
UPDATE = 1 ;
18
18
CREATE = 2 ;
19
19
}
20
- ;
21
20
22
21
enum CodegenFileType : int {
23
22
PHP = 0 ;
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ namespace Facebook\HackCodegen\_Private;
13
13
*
14
14
* The string can be retrived once via the `detach()` method.
15
15
*/
16
- class StrBuffer {
16
+ final class StrBuffer {
17
17
18
18
private string $str = ' ' ;
19
19
private bool $detached = false ;
Original file line number Diff line number Diff line change @@ -16,15 +16,15 @@ use type Facebook\HackCodegen\{
16
16
IHackCodegenConfig ,
17
17
};
18
18
19
- class HackBuilderNativeValueCollectionRenderer <Tv , T as Traversable <Tv >>
19
+ final class HackBuilderNativeValueCollectionRenderer <Tv , T as Traversable <Tv >>
20
20
implements IHackBuilderValueRenderer <T > {
21
21
public function __construct (
22
22
private ContainerType $container ,
23
23
private IHackBuilderValueRenderer <Tv > $valueRenderer ,
24
24
) {
25
25
}
26
26
27
- final public function render (IHackCodegenConfig $config , T $values ): string {
27
+ public function render (IHackCodegenConfig $config , T $values ): string {
28
28
$value_renderer = $this -> valueRenderer ;
29
29
$builder = (new HackBuilder ($config ))-> openContainer($this -> container );
30
30
foreach ($values as $value ) {
Original file line number Diff line number Diff line change 9
9
10
10
namespace Facebook\HackCodegen ;
11
11
12
- class OnExit implements \ IDisposable {
12
+ final class OnExit implements \ IDisposable {
13
13
const type TCallback = (function ():void);
14
14
public function __construct (private self ::TCallback $cb ) {
15
15
}
You can’t perform that action at this time.
0 commit comments