# jch-optimize/trunk/lib/src/Exception/StringableTrait.php

JCH Optimize, version trunk. 31 lines.

- Page: https://pluginprobe.com/plugins/jch-optimize/trunk/code/lib/src/Exception/StringableTrait.php
- Raw: https://pluginprobe.com/plugins/jch-optimize/trunk/raw/lib/src/Exception/StringableTrait.php
- Modified: 2025-06-11T23:50:14+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/jch-optimize/trunk/code/lib/src/Exception/StringableTrait.php#L10-L20`.

```php
<?php

/**
 * JCH Optimize - Performs several front-end optimizations for fast downloads
 *
 * @package   jchoptimize/core
 * @author    Samuel Marshall <samuel@jch-optimize.net>
 * @copyright Copyright (c) 2022 Samuel Marshall / JCH Optimize
 * @license   GNU/GPLv3, or later. See LICENSE file
 *
 *  If LICENSE file missing, see <http://www.gnu.org/licenses/>.
 */

namespace JchOptimize\Core\Exception;

use function defined;

defined('_JCH_EXEC') or die('Restricted access');

/**
 * @package     JchOptimize\Core
 */
trait StringableTrait
{
    public function __toString()
    {
        return get_class($this) . " '{$this->getMessage()}' in {$this->getFile()}({$this->getLine()})\n"
            . "{$this->getTraceAsString()}";
    }
}

```
