Baleen\Cli\CommandBus\Config\StatusHandler

class StatusHandler

Handles the config:status command.

property output

protected OutputInterface

property message

protected StatusMessage

handle(StatusMessage $message)

Handles a StatusMessage, which prints the status of the migrations system in a developer-friendly format (inspired by “git status”).

Parameters:
printPendingVersion(Version $version, $style)

Formats and prints a pending version with the given style.

Parameters:
  • $version (Version) – The Version to print.
  • $style (string) – One of the STYLE_* constants.
getRelativePath($from, $to)

Returns the relative path between two known paths.

Parameters:
  • $from
  • $to
Returns:

string

printDiff($versions, $message, $style = self::STYLE_INFO)

Prints an array (group) of Versions all with the given style. If the array is empty then it prints nothing.

Parameters:
  • $versions (array) –
  • $message (string|string[]) – Message(s) to print before the group of versions.
  • $style (string) – One of the STYLE_* constants.
splitDiff($diff, $comparator, Version $head)

Splits an array of Versions into two arrays and returns them. The first one contains all versions before the HEAD (latest migrated) Version, and the second one contains all Versions after HEAD. Head is never included in either of the arrays.

Parameters:
  • $diff (Version[]) – The array of Versions that should be split.
  • $comparator (callable) – The comparator used to sort Versions.
  • $head (Version) – The HEAD version.
Returns:

array