mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-25 04:56:23 +00:00
20 lines
349 B
Markdown
20 lines
349 B
Markdown
|
---
|
||
|
id: f3eefc1b-34f9-41e8-a22b-33e87f94c29a
|
||
|
title: define()
|
||
|
---
|
||
|
|
||
|
# Syntax
|
||
|
|
||
|
``` php
|
||
|
// Before
|
||
|
$resolver->setRequired('host');
|
||
|
$resolver->setDefaults(['host' => 'smtp.example.org']);
|
||
|
$resolver->setAllowedTypes('host', 'string');
|
||
|
|
||
|
// After
|
||
|
$resolver->define('host')
|
||
|
->required()
|
||
|
->default('smtp.example.org')
|
||
|
->allowedTypes('string');
|
||
|
```
|