October\Rain\Support\SafeCollection

Overview

SafeCollection is a collection proxy class that is safe for use in Twig without exposing callable functions, which are unusable in Twig anyway.

Implements
  • October\Contracts\Twig\CallsAnyMethod

Protected Properties

protected Collection $collection

collection instance

protected array $hybridCallableArgs

hybridCallableArgs are methods that can take a string value or a callable array. This allows callable strings that might be used as attributes, e.g. 'passthru'


Public Methods

public __call()

public __call(string $method, array $parameters): mixed 

__call magic

public __construct()

public __construct($collection): void

Protected Methods

protected forwardCallTo()

protected forwardCallTo(
    mixed $object,
    string $method,
    array $parameters
): mixed 

Forward a method call to the given object.

protected forwardDecoratedCallTo()

protected forwardDecoratedCallTo(
    mixed $object,
    string $method,
    array $parameters
): mixed 

Forward a method call to the given object, returning $this if the forwarded call returned itself.

protected static throwBadMethodCallException()

protected static throwBadMethodCallException(string $method): void 

Throw a bad method call exception for the given method.