<commit_before><?hh

class Foo {

    //Typed properties (and scalar typehint)
    private int $num = 123;

    //Return typehints
    public function add(int $delta): Foo {
        $this->num += $delta;
        return $this;
    }

    public function get(): int {
        return $this->num;
    }

    // Constructor arg promotion
    public function __constructor(private int $num): void {
    }
}

$f = new Foo(123);
$f->add(456);

// gives error with hh_client
$f->add("banana");<commit_msg>add main function()<commit_after><?hh

class Foo {

    //Typed properties (and scalar typehint)
    private int $num = 123;

    //Return typehints
    public function add(int $delta): Foo {
        $this->num += $delta;
        return $this;
    }

    public function get(): int {
        return $this->num;
    }

    // Constructor arg promotion
    public function __constructor(private int $num): void {
    }
}

//needed, typechecker doesn't check in global space
function main() {

    $f = new Foo(123);
    $f->add(456);

    // gives error with hh_client
    $f->add("banana");
}

main();
{'fraction_non_alphanumeric': 0.13777372262773724, 'fraction_numerical': 0.016423357664233577, 'mean_word_length': 2.438871473354232, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4690781', 'n_tokens_mistral': 371, 'n_tokens_neox': 342, 'n_words': 105}