class OnboardingSteps

Onboarding step definition This contains all the logic for creating, and accessing onboarding steps.

Traits

Singleton trait.

Properties

static protected $instance from  Singleton
static private array $callbacks
private array $steps

Methods

static 
instance()

Create a new instance of this singleton.

static 
forgetInstance()

Forget this singleton's instance if it exists

__construct()

Constructor.

initialize()

Initialize the singleton free from constructor parameters.

__clone()

No description

__wakeup()

No description

getStep($code)

No description

removeStep($code)

No description

array
listSteps()

Returns a list of registered onboarding steps.

bool
completed()

Determine if all onboarding is complete.

bool
inProgress()

Determine if the onboarding is still in progress.

null|stdClass
nextIncompleteStep()

Get the next incomplete onboarding step, or null if all steps are completed.

stepIsCompleted($callable)

No description

loadSteps()

No description

registerSteps(array $definitions)

Registers the onboarding steps.

static 
registerCallback(callable $callback)

Manually registers onboarding steps.

Details

in Singleton at line 18
final static instance()

Create a new instance of this singleton.

in Singleton at line 28
final static forgetInstance()

Forget this singleton's instance if it exists

in Singleton at line 36
final protected __construct()

Constructor.

in Singleton at line 44
protected initialize()

Initialize the singleton free from constructor parameters.

in Singleton at line 48
__clone()

No description

in Singleton at line 53
__wakeup()

No description

at line 26
getStep($code)

No description

Parameters

$code

at line 34
removeStep($code)

No description

Parameters

$code

at line 44
array listSteps()

Returns a list of registered onboarding steps.

Return Value

array

Array keys are codes, values are onboarding steps meta array.

at line 57
bool completed()

Determine if all onboarding is complete.

Return Value

bool

at line 69
bool inProgress()

Determine if the onboarding is still in progress.

Return Value

bool

at line 79
null|stdClass nextIncompleteStep()

Get the next incomplete onboarding step, or null if all steps are completed.

Return Value

null|stdClass

at line 86
protected stepIsCompleted($callable)

No description

Parameters

$callable

at line 95
protected loadSteps()

No description

at line 130
registerSteps(array $definitions)

Registers the onboarding steps.

The argument is an array of the onboarding steps definition.

Parameters

array $definitions

at line 166
static registerCallback(callable $callback)

Manually registers onboarding steps.

Usage:

  Onboarding::registerCallback(function($manager){
      $manager->registerSteps([...]);
  });

Parameters

callable $callback

A callable function.