---
title: Function Names Verb-Noun
impact: LOW
impactDescription: makes code self-documenting
tags: naming, functions, readability, conventions, quality, php
---

## Function Names Verb-Noun

Functions represent actions. Using "Verb-Noun" pattern makes the purpose of the function clear and the code self-documenting.

**Incorrect (vague names):**

```php
function user() { }           // Noun only
function userData() { }       // Noun only
function process() { }        // Vague
function handle() { }         // Vague
function stuff() { }          // Noun only
```

**Correct (action verbs):**

```php
function getUser() { }
function createUserAccount() { }
function validateEmailFormat() { }
function calculateTotalPrice() { }
function sendConfirmationEmail() { }
function convertCurrencyToUSD() { }
function hasActiveSubscription(): bool { }
```

**Verb categories:**

| Category | Verbs |
|----------|-------|
| Retrieval | `get`, `fetch`, `find`, `load`, `query` |
| Creation | `create`, `build`, `make`, `generate` |
| Modification | `set`, `update`, `modify`, `change`, `save` |
| Deletion | `delete`, `remove`, `destroy`, `clear` |
| Validation | `validate`, `verify`, `check`, `ensure` |
| Computation | `calculate`, `compute`, `parse`, `format` |
| Boolean | `is`, `has`, `can`, `should`, `will` |

**Tools:** PR review, PHPStan, Psalm
