master

laravel/framework

Last updated at: 29/12/2023 09:21

CanBeEscapedWhenCastToString.php

TLDR

This file is an interface called CanBeEscapedWhenCastToString located in the Illuminate\Contracts\Support namespace. It provides a method called escapeWhenCastingToString which allows indicating that the object's string representation should be escaped when the __toString() method is invoked.

Methods

escapeWhenCastingToString

This method allows indicating that the object's string representation should be escaped when the __toString() method is invoked. It accepts a boolean parameter $escape which defaults to true. This method returns the instance of the object itself.

Classes

There are no classes in this file.

<?php

namespace Illuminate\Contracts\Support;

interface CanBeEscapedWhenCastToString
{
    /**
     * Indicate that the object's string representation should be escaped when __toString is invoked.
     *
     * @param  bool  $escape
     * @return $this
     */
    public function escapeWhenCastingToString($escape = true);
}