master

laravel/framework

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

AppendableAttributeValue.php

TLDR

This file defines a class called AppendableAttributeValue which implements the Stringable interface. It has a constructor method to set the value of the attribute and a magic method __toString() which returns the string representation of the attribute value.

Classes

AppendableAttributeValue

This class represents an appendable attribute value. It has the following properties and methods:

Properties

  • $value: The attribute value.

Methods

  • __construct($value): This method creates a new instance of the AppendableAttributeValue class and sets the value of the attribute.

__toString()

This magic method returns the string representation of the attribute value.

<?php

namespace Illuminate\View;

use Stringable;

class AppendableAttributeValue implements Stringable
{
    /**
     * The attribute value.
     *
     * @var mixed
     */
    public $value;

    /**
     * Create a new appendable attribute value.
     *
     * @param  mixed  $value
     * @return void
     */
    public function __construct($value)
    {
        $this->value = $value;
    }

    /**
     * Get the string value.
     *
     * @return string
     */
    public function __toString()
    {
        return (string) $this->value;
    }
}