---
title: "lint/laravel/prefer-container-method-call"
pagination: false
---

{/* Generated by scripts/gen-rule-docs.py. Edit mapping.toml, not this file. */}

<RuleId id="lint/laravel/prefer-container-method-call" />

Not in any set. Unsafe fix: it can change behaviour. Runs when laravel is installed. **Planned: not in Pun yet.** Enabling it is a config error.

## What it does

Change array access on the container to the matching method call, as the contract does not extend ArrayAccess

## Replaces

- [`ContainerArrayAccessToMethodCall`](https://getrector.com/rule-detail/container-array-access-to-method-call-rector) (rector-laravel)

[More lint/laravel rules](/docs/rules/lint/laravel) · [Edit this page](https://github.com/shipfastlabs/pun/edit/main/crates/pun-config/rules/mapping.toml)
