class DateFactory (View source)

Constants

DEFAULT_CLASS_NAME

The default class that will be used for all created dates.

Properties

static protected string $dateClass The type (class) of dates that should be created.
static protected callable $callable This callable may be used to intercept date creation.
static protected object $factory The Carbon factory that should be used when creating dates.

Methods

static mixed
use(mixed $handler)

Use the given handler when generating dates (class name, callable, or factory).

static void
useDefault()

Use the default date class when generating dates.

static void
useCallable(callable $callable)

Execute the given callable on each date creation.

static void
useClass(string $dateClass)

Use the given date type (class) when generating dates.

static void
useFactory(object $factory)

Use the given Carbon factory when generating dates.

mixed
__call(string $method, array $parameters)

Handle dynamic calls to generate dates.

Details

static mixed use(mixed $handler)

Use the given handler when generating dates (class name, callable, or factory).

Parameters

mixed $handler

Return Value

mixed

Exceptions

InvalidArgumentException

static void useDefault()

Use the default date class when generating dates.

Return Value

void

static void useCallable(callable $callable)

Execute the given callable on each date creation.

Parameters

callable $callable

Return Value

void

static void useClass(string $dateClass)

Use the given date type (class) when generating dates.

Parameters

string $dateClass

Return Value

void

static void useFactory(object $factory)

Use the given Carbon factory when generating dates.

Parameters

object $factory

Return Value

void

mixed __call(string $method, array $parameters)

Handle dynamic calls to generate dates.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

RuntimeException