Skip to content

Commit

Permalink
Added docs for ConstructorAssemblerOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
joshhornby committed Oct 13, 2018
1 parent 7c0e23c commit 1003ab4
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions docs/code-generation/assemblers.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,41 @@ Example output:
}
```

Generating type-hints is disabled by default, but can be enabled by passing `ConstructorAssemblerOptions` instance to the constructor with the option `withTypeHints` set to true.

Example
```php
new ConstructorAssembler((new ConstructorAssemblerOptions())->withTypeHints())
```

```php
/**
* Constructor
*
* @var string $prop1
* @var int $prop2
*/
public function __construct(string $prop1, int $prop2)
{
$this->prop1 = $prop1;
$this->prop2 = $prop2;
}
```

Generating doc blocks is enabled by default, but can be disabled by passing `ConstructorAssemblerOptions` instance to the constructor with the option `withDocBlocks` set to false. This is normally used in conjunction with `withTypeHints`

Example
```php
new ConstructorAssembler((new ConstructorAssemblerOptions())->withDocBlocks(false)->withTypeHints())
```

```php
public function __construct(string $prop1, int $prop2)
{
$this->prop1 = $prop1;
$this->prop2 = $prop2;
}
```

## FluentSetterAssembler

Expand Down

0 comments on commit 1003ab4

Please sign in to comment.