gossi\codegen\config\CodeFileGeneratorConfig::setDeclareStrictTypes PHP Method

setDeclareStrictTypes() public method

Sets whether a declare(strict_types=1); statement should be printed below the header comments (PHP 7)
public setDeclareStrictTypes ( boolean $strict )
$strict boolean `true` if it will be printed and `false` if not
    public function setDeclareStrictTypes($strict)
    {
        $this->options['declareStrictTypes'] = $strict;
        return $this;
    }

Usage Example

 public function testCodeFileGeneratorConfigSetters()
 {
     $config = new CodeFileGeneratorConfig();
     $this->assertEquals('hello world', $config->setHeaderComment('hello world')->getHeaderComment());
     $docblock = new Docblock();
     $this->assertSame($docblock, $config->setHeaderDocblock($docblock)->getHeaderDocblock());
     $this->assertFalse($config->setBlankLineAtEnd(false)->getBlankLineAtEnd());
     $this->assertTrue($config->setDeclareStrictTypes(true)->getDeclareStrictTypes());
 }