---
title: "Void return types"
canonical_url: "https://handbook.propay.co.za/php/void-types"
---
# Void return types

If a method returns nothing, it SHOULD be indicated with `void`. This makes it more clear to the users of your code what your intention was when writing it.

<code-group>

```php [UserController.php]
namespace App\Http\Controllers;

class UserController extends Controller
{
    public function create(array $data): void
    {
        User::create($data);
    }
}
```

</code-group>


## Sitemap

See the full [sitemap](https://handbook.propay.co.za/sitemap.md) for all pages.
