Back to ExtensionDiscoverInstallCommand class

Method getNote

public string
getNote
(int $count, int $eid)
Used for finding the text for the note
Parameters
  • int $count Number of extensions to install
  • int $eid ID of the extension or -1 if no special
Returns
  • string The text for the note
Since
  • 4.0.0

Method getNote - Source code

/**
 * Used for finding the text for the note
 *
 * @param   int  $count   Number of extensions to install
 * @param   int  $eid     ID of the extension or -1 if no special
 *
 * @return  string  The text for the note
 *
 * @since   4.0.0
 */
public function getNote(int $count, int $eid) : string
{
    if ($count < 0 && $eid >= 0) {
        return 'Unable to install the extension with ID ' . $eid;
    } elseif ($count < 0 && $eid < 0) {
        return 'Unable to install discovered extensions.';
    } elseif ($count === 0) {
        return 'There are no pending discovered extensions for install. Perhaps you need to run extension:discover first?';
    } elseif ($count === 1 && $eid > 0) {
        return 'Extension with ID ' . $eid . ' installed successfully.';
    } elseif ($count === 1 && $eid < 0) {
        return $count . ' discovered extension has been installed.';
    } elseif ($count > 1 && $eid < 0) {
        return $count . ' discovered extensions have been installed.';
    } else {
        return 'The return value is not possible and has to be checked.';
    }
}