# Composer (/pipeline-sdk/reference/toolchains/composer)



{/* Generated by docs-site/scripts/generate-dsl-docs.ts — do not edit. */}

## `composer` [#composer]

Callable singleton for the Composer toolchain — access as `hm.composer`.

Call directly to construct a `ComposerProject`, or use the bare-form
action methods (`composer.test()`, `composer.lint()`) for a one-shot leaf.

```python
composer(*, path='.', laravel=False, image=None, base=None) -> ComposerProject
```

| Parameter                                           | Type           | Default | Description                                              |
| --------------------------------------------------- | -------------- | ------- | -------------------------------------------------------- |
| `path`                                              | `str`          | `'.'`   | Path to the PHP project root (must contain a             |
| `composer.lock`).                                   |                |         |                                                          |
| `laravel`                                           | `bool`         | `False` | When `True`, uses `php artisan test` for `.test()`       |
| and sets the label prefix to `:laravel:` instead of |                |         |                                                          |
| `:php:`.                                            |                |         |                                                          |
| `image`                                             | `str \| None`  | `None`  | Local-mode Docker base image override.                   |
| `base`                                              | `Step \| None` | `None`  | Existing `Step` to attach to instead of emitting a fresh |
| apt-base step.                                      |                |         |                                                          |

**Returns** `ComposerProject` — A `ComposerProject` whose `installed` step is `composer install`.

### `composer.lint()` [#composerlint]

```python
lint(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `composer.test()` [#composertest]

```python
test(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

## `ComposerEntry` [#composerentry]

Callable singleton for the Composer toolchain — access as `hm.composer`.

Call directly to construct a `ComposerProject`, or use the bare-form
action methods (`composer.test()`, `composer.lint()`) for a one-shot leaf.

### `ComposerEntry.lint()` [#composerentrylint]

```python
lint(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `ComposerEntry.test()` [#composerentrytest]

```python
test(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

## `ComposerProject` [#composerproject]

Composer (PHP/Laravel) project install chain — constructed via `hm.composer()`.

`installed` is the `composer install` step. Action methods (`test`,
`lint`) attach leaves to `installed`.

### Fields [#fields]

| Field       | Type   | Default    |
| ----------- | ------ | ---------- |
| `path`      | `str`  | *required* |
| `installed` | `Step` | *required* |

### `ComposerProject.lint()` [#composerprojectlint]

```python
lint(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `ComposerProject.test()` [#composerprojecttest]

```python
test(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`
