Skip to content

Commit

Permalink
updating examples for 7.4 syntax + @readonly docblock
Browse files Browse the repository at this point in the history
  • Loading branch information
SignpostMarv committed Dec 18, 2019
1 parent b3d0729 commit eb31740
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,20 @@ use SignpostMarv\DaftTypedObject\Immutable as Base;
* @psalm-type DATA = array{id:int, name:string}
*
* @template-extends Base<DATA, DATA>
*
* @property-read int $id
* @property-read string $name
*/
class Immutable extends Base
{
const TYPED_PROPERTIES = ['id', 'name'];

/**
* @var int
* @readonly
*/
protected $id;
public int $id;

/**
* @var string
* @readonly
*/
protected $name;
public string $name;
}
```

Expand All @@ -46,23 +43,14 @@ use SignpostMarv\DaftTypedObject\DaftTypedObject as Base;
* @psalm-type DATA = array{id:int, name:string}
*
* @template-extends Base<DATA, DATA>
*
* @property int $id
* @property string $name
*/
class Mutable extends Base
{
const TYPED_PROPERTIES = ['id', 'name'];

/**
* @var int
*/
protected $id;
public int $id;

/**
* @var string
*/
protected $name;
public string $name;
}

```
Expand Down

0 comments on commit eb31740

Please sign in to comment.