Skip to content
This repository was archived by the owner on Aug 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/dorm/CodegenDorm.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* that will allow to read the data from a database and store it
* in the object.
*/
class CodegenDorm {
final class CodegenDorm {

private ICodegenFactory $codegen;

Expand Down
4 changes: 2 additions & 2 deletions examples/dorm/CodegenMutator.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* For a given DormSchema, this class generates code for a class
* that will allow to insert rows in a database.
*/
class CodegenMutator {
final class CodegenMutator {

private HackCodegenFactory $codegen;

Expand Down Expand Up @@ -211,7 +211,7 @@ private function getCheckRequiredFieldsMethod(): CodegenMethod {
->closeStatement()
->addAssignment(
'$missing',
'$required->removeAll($this->data->keys());',
'$required->removeAll($this->data->keys())',
HackBuilderValues::literal(),
)
->addMultilineCall(
Expand Down
2 changes: 1 addition & 1 deletion examples/dorm/core/DormField.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace Facebook\HackCodegen;

class DormField {
final class DormField {
private bool $optional = false;
private bool $manual = false;

Expand Down
4 changes: 2 additions & 2 deletions examples/dorm/demo/DormUserMutator.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* To re-generate this file run codegen.php DormUserSchema
*
*
* @partially-generated SignedSource<<cfcc245af5ac1dc449999b80c6e0ecef>>
* @partially-generated SignedSource<<9a620c7d596d01640d6d302a4bdfae46>>
*/

final class DormUserMutator {
Expand Down Expand Up @@ -59,7 +59,7 @@ public function checkRequiredFields(): void {
'last_name',
'is_active',
};
$missing = $required->removeAll($this->data->keys());;
$missing = $required->removeAll($this->data->keys());
invariant(
$missing->isEmpty(),
'The following required fields are missing: %s',
Expand Down
2 changes: 1 addition & 1 deletion examples/dorm/demo/DormUserSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace Facebook\HackCodegen;

class DormUserSchema implements DormSchema {
final class DormUserSchema implements DormSchema {
public function getFields(): Map<string, DormField> {
return Map {
'FirstName' => string_field('first_name'),
Expand Down
1 change: 0 additions & 1 deletion src/CodegenFile.hack
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ enum CodegenFileResult: int {
UPDATE = 1;
CREATE = 2;
}
;

enum CodegenFileType: int {
PHP = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/HackfmtFormatter.hack
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class HackfmtFormatter implements ICodegenFormatter {
$output = vec[];
$exit_code = null;

$tempnam = \tempnam(\sys_get_temp_dir(), 'hack-codegen-hackfmt');
$tempnam = \tempnam(\sys_get_temp_dir(), 'hack-codegen-hackfmt').'.hack';

$options = $this->getFormattedOptions();

Expand Down
2 changes: 1 addition & 1 deletion src/_Private/StrBuffer.hack
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Facebook\HackCodegen\_Private;
*
* The string can be retrived once via the `detach()` method.
*/
class StrBuffer {
final class StrBuffer {

private string $str = '';
private bool $detached = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ use type Facebook\HackCodegen\{
IHackCodegenConfig,
};

class HackBuilderNativeValueCollectionRenderer<Tv, T as Traversable<Tv>>
final class HackBuilderNativeValueCollectionRenderer<Tv, T as Traversable<Tv>>
implements IHackBuilderValueRenderer<T> {
public function __construct(
private ContainerType $container,
private IHackBuilderValueRenderer<Tv> $valueRenderer,
) {
}

final public function render(IHackCodegenConfig $config, T $values): string {
public function render(IHackCodegenConfig $config, T $values): string {
$value_renderer = $this->valueRenderer;
$builder = (new HackBuilder($config))->openContainer($this->container);
foreach ($values as $value) {
Expand Down
2 changes: 1 addition & 1 deletion tests/TestLib/OnExit.hack
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace Facebook\HackCodegen;

class OnExit implements \IDisposable {
final class OnExit implements \IDisposable {
const type TCallback = (function():void);
public function __construct(private self::TCallback $cb) {
}
Expand Down