gossi\codegen\tests\generator\CodeFileGeneratorTest::testStrictTypesDeclaration PHP Method

testStrictTypesDeclaration() public method

    public function testStrictTypesDeclaration()
    {
        $expected = "<?php\ndeclare(strict_types=1);\n\nfunction fn(\$a) {\n}\n";
        $fn = PhpFunction::create('fn')->addParameter(PhpParameter::create('a'));
        $codegen = new CodeFileGenerator(['generateDocblock' => false, 'generateEmptyDocblock' => false, 'declareStrictTypes' => true]);
        $code = $codegen->generate($fn);
        $this->assertEquals($expected, $code);
    }