src/Helper/Placeholder.php
public function attach($value, $capture = null)
    {
        if (null === $capture) {
            $capture = $this->captureType;
        }

        switch ($capture) {
            case self::APPEND:
                $this->append($value);
                break;
            case self::PREPEND:
                $this->prepend($value);
                break;
            case self::SET:
                $this->set($value);
                break;
            default:
                throw new InvalidArgumentException(sprintf(
                    'Invalid capture type provided; must be any of the capture '
                    . 'type constants, "%s" received.',
                    is_scalar($capture) ? $capture : gettype($capture)
                ));
        }

        return $this;
    }
public function attach($value, $capture = null)
    {
        if (null === $capture) {
            $capture = $this->captureType;
        }

        switch ($capture) {
            case self::APPEND:
                $this->append($value);
                break;
            case self::PREPEND:
                $this->prepend($value);
                break;
            case self::SET:
                $this->set($value);
                break;
            default:
                throw new InvalidArgumentException(sprintf(
                    'Invalid capture type provided; must be any of the capture '
                    . 'type constants, "%s" received.',
                    is_scalar($capture) ? $capture : gettype($capture)
                ));
        }

        return $this;
    }
public function attach ( $ value , $ capture = null ) { if ( null === $ capture ) { $ capture = $ this -> captureType ; } switch ( $ capture ) { case self :: APPEND : $ this -> append ( $ value ) ; break ; case self :: PREPEND : $ this -> prepend ( $ value ) ; break ; case self :: SET : $ this -> set ( $ value ) ; break ; default : throw new InvalidArgumentException ( sprintf ( 'Invalid capture type provided; must be any of the capture ' . 'type constants, "%s" received.' , is_scalar ( $ capture ) ? $ capture : gettype ( $ capture ) ) ) ; } return $ this ; }
Attaches the value.

@param mixed       $value   The value
@param null|string $capture Optional; any of the capture type constants

@throws \InvalidArgumentException If invalid capture type provided

@return self
Attaches the value .