Skip to content
This repository has been archived by the owner on Jun 22, 2022. It is now read-only.

Commit

Permalink
Re-format to spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
calebporzio committed Jun 22, 2018
1 parent c4af926 commit 7c47517
Showing 1 changed file with 50 additions and 50 deletions.
100 changes: 50 additions & 50 deletions src/OnboardingManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,62 +4,62 @@

/**
* The gateway into the package. This class exposes the overall
* state of the onboarding instance. It will typically be
* state of the onboarding instance. It will typically be
* accessed like so: $user->onboarding()
*/
class OnboardingManager {
/**
* All defined onboarding steps.
*
* @var array
*/
public $steps;
/**
* All defined onboarding steps.
*
* @var array
*/
public $steps;

/**
* Create the Onboarding Manager (should always be a singleton).
*
* @param mixed $user The parent app's user model.
* @param \Calebporzio\Onboard\OnboardingSteps $onboardingSteps
*/
public function __construct($user, OnboardingSteps $onboardingSteps)
{
$this->steps = $onboardingSteps->steps($user);
}
/**
* Create the Onboarding Manager (should always be a singleton).
*
* @param mixed $user The parent app's user model.
* @param \Calebporzio\Onboard\OnboardingSteps $onboardingSteps
*/
public function __construct($user, OnboardingSteps $onboardingSteps)
{
$this->steps = $onboardingSteps->steps($user);
}

/**
* An accessor for the $steps property
*
* @return array
*/
public function steps()
{
return $this->steps;
}
/**
* An accessor for the $steps property
*
* @return array
*/
public function steps()
{
return $this->steps;
}

/**
* Determine if the users's onboarding is still in progress.
*
* @return bool
*/
public function inProgress()
{
return ! $this->finished();
}
/**
* Determine if the users's onboarding is still in progress.
*
* @return bool
*/
public function inProgress()
{
return ! $this->finished();
}

/**
* Determine if the users's onboarding is complete.
*
* @return bool
*/
public function finished()
{
return collect($this->steps)->filter(function ($step) {
// Leave only incomplete steps.
return $step->incomplete();
})
// Report onboarding is finished if no incomplete steps remain.
->isEmpty();
}
/**
* Determine if the users's onboarding is complete.
*
* @return bool
*/
public function finished()
{
return collect($this->steps)->filter(function ($step) {
// Leave only incomplete steps.
return $step->incomplete();
})
// Report onboarding is finished if no incomplete steps remain.
->isEmpty();
}

/**
* Get the next unfinished onboarding step, or null if already all steps are completed.
Expand All @@ -71,5 +71,5 @@ public function nextUnfinishedStep()
return collect($this->steps)->first(function ($step) {
return $step->incomplete();
});
}
}
}

0 comments on commit 7c47517

Please sign in to comment.