# $pricingRules->getRuleByKey()

> Gets the pricing rule by its key

- Source: `src/PricingRules.php#L88` <https://github.com/wagnerwagner/merx/blob/2.0.0-alpha.11/src/PricingRules.php#L88>

```php
$pricingRules->getRuleByKey(null|string $key): null|Wagnerwagner\Merx\PricingRule
```

## Parameters

| Name | Type | Default |
| --- | --- | --- |
| `$key` | `null\|string` | `–` |

## Return type

`null|Wagnerwagner\Merx\PricingRule`

## Parent class

`Wagnerwagner\Merx\PricingRules`
