# PhpExportDetector

> Detects a log message that is the var_export() or VarDumper::export() output of an array or object and returns it in short array syntax.

[API reference](/docs/api/index.md) › [Debug Core](/docs/extensions/debug-core/reference/index.md) › [Panel](/docs/extensions/debug-core/reference/panel/index.md) › [Log](/docs/extensions/debug-core/reference/panel/log/index.md) › PhpExportDetector

| final class | `PHPForge\Debug\Panel\Log\PhpExportDetector` |
| --- | --- |
| Source | [`src/Panel/Log/PhpExportDetector.php`](https://github.com/php-forge/debug-core/blob/main/src/Panel/Log/PhpExportDetector.php#L27) |

Detects a log message that is the `var_export()` or `VarDumper::export()` output of an array or object and returns it
in short array syntax.

Never evaluates the message and never changes string contents; only the array syntax and indentation are rewritten.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`detect()`](#method-detect) static | Returns a PHP value export in short array syntax. | `PhpExportDetector` |

## Method details

### detect() <span id="method-detect"></span>

```php
public static function detect(string $message): string|null
```

Returns a PHP value export in short array syntax.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$message` | `string` |  |

**Returns**

`string|null`: Export source, or `null` when the message is not one export expression within the bounds.