ChangelogEntryCommand

Class
extends BaseCommand
Final: Yes

Inserts a changelog entry into the managed changelog file.

Attributes
#[AsCommand]
$name : 'changelog:entry'
$description : 'Adds a changelog entry to Unreleased or a specific version section.'
$help : 'This command appends one categorized changelog entry to the selected changelog file so it can be reused by local authoring flows and skills.'

Table of Contents

Interfaces

LoggerAwareCommandInterface

Defines the logger contract consumed by reusable command result helpers.

Properties

Methods

 : mixed
addJsonOption()

Adds the standard JSON output options to the current command.

 : static
configure()

Configures the entry authoring arguments and options.

 : void
execute()

Appends a changelog entry to the requested section.

 : int
isJsonOutput()

Determines whether JSON output was requested.

 : bool
isPrettyJsonOutput()

Determines whether pretty JSON output was requested.

 : bool
failure()

Logs a failed command result and returns the failure exit code.

 : int
notice()

Logs an informational command message at notice level.

 : void
success()

Logs a successful command result and returns the success exit code.

 : int
Properties
Methods

addJsonOption()

Protected

Adds the standard JSON output options to the current command.

protected addJsonOption() : static
Return values
static

configure()

Protected

Configures the entry authoring arguments and options.

protected configure() : void

execute()

Protected

Appends a changelog entry to the requested section.

protected execute(InputInterface  $input, OutputInterface  $output) : int
Parameters
$input : InputInterface
$output : OutputInterface
Return values
int

isJsonOutput()

Protected

Determines whether JSON output was requested.

protected isJsonOutput(InputInterface  $input) : bool

Description

The pretty-json flag SHALL imply JSON output.

Parameters
$input : InputInterface
Return values
bool

isPrettyJsonOutput()

Protected

Determines whether pretty JSON output was requested.

protected isPrettyJsonOutput(InputInterface  $input) : bool
Parameters
$input : InputInterface
Return values
bool

failure()

Private

Logs a failed command result and returns the failure exit code.

private failure( string  $message, InputInterface  $input[, array<string, mixed>  $context = []][, string|null  $file = null][, int|null  $line = null]) : int
Parameters
$message : string

Description

the failure message

$input : InputInterface

Description

the originating command input

$context : array<string, mixed> = []

Description

optional extra log context

$file : string|null = null

Description

the related file path when known

$line : int|null = null

Description

the related line when known

Return values
int

notice()

Private

Logs an informational command message at notice level.

private notice( string  $message, InputInterface  $input[, array<string, mixed>  $context = []]) : void
Parameters
$message : string

Description

the notice message

$input : InputInterface

Description

the originating command input

$context : array<string, mixed> = []

Description

optional extra log context

success()

Private

Logs a successful command result and returns the success exit code.

private success( string  $message, InputInterface  $input[, array<string, mixed>  $context = []][, string  $logLevel = LogLevel::INFO]) : int
Parameters
$message : string

Description

the success message

$input : InputInterface

Description

the originating command input

$context : array<string, mixed> = []

Description

optional extra log context

$logLevel : string = LogLevel::INFO

Description

the PSR-3 log level used for the successful result

Return values
int