Cecil

DoctorSeo extends AbstractCommand

SEO doctor command.

This command builds the site in dry-run mode and audits the rendered HTML pages for a focused set of SEO checks inspired by editorial audit tools.

Table of Contents

Constants

CONFIG_FILE  : mixed = ['cecil.yml', 'config.yml']
EXCLUDED_CMD  : mixed = ['about', 'new:site', 'self-update', 'serve:stop']
PID_FILE  : mixed = \Cecil\Builder::TMP_DIR . '/server.pid'
SERVE_OUTPUT  : mixed = \Cecil\Builder::TMP_DIR . '/preview'
PAGE_LABEL_MAX_LENGTH  : mixed = 60

Properties

$input  : InputInterface
$io  : CecilStyle
$output  : OutputInterface
$rootPath  : string
$format  : string
$includeFeedback  : bool
$includeVirtual  : bool

Methods

getProcessedHelp()  : string
Override default help message.
notification()  : void
Send desktop notification.
run()  : int
{@inheritdoc}
validateUrl()  : string
Validate URL.
binName()  : string
Returns the "binary name" in the console context.
configure()  : mixed
{@inheritdoc}
execute()  : int
{@inheritdoc}
getBuilder()  : Builder
Creates or returns a Builder instance.
getConfigFiles()  : array<string|int, mixed>
Returns config file(s) path.
getPath()  : string|null
Returns the working path.
initialize()  : mixed
{@inheritdoc}
locateAdditionalConfigFiles()  : array<string|int, mixed>
Locates additional configuration file(s) from the given list of files, relative to the given path or absolute.
locateConfigFile()  : array<string|int, mixed>
Locates the configuration in the given path, as an array of the file name and path, if file exists, otherwise default name and false.
openEditor()  : void
Opens path with editor.
buildFilteredResult()  : array{summary: array{pages_audited: int, pages_without_findings: int, bad_count: int, ok_count: int, feedback_count: int}, findings: array}
filterResultWithoutLevel()  : array{summary: array{pages_audited: int, pages_without_findings: int, bad_count: int, ok_count: int, feedback_count: int}, findings: array}
formatLevel()  : string
outputJson()  : void
Output results in JSON format.
outputText()  : void
Output results in text format (tables).
truncatePageLabel()  : string

Constants

EXCLUDED_CMD

public mixed EXCLUDED_CMD = ['about', 'new:site', 'self-update', 'serve:stop']

PID_FILE

public mixed PID_FILE = \Cecil\Builder::TMP_DIR . '/server.pid'

SERVE_OUTPUT

public mixed SERVE_OUTPUT = \Cecil\Builder::TMP_DIR . '/preview'

PAGE_LABEL_MAX_LENGTH

private mixed PAGE_LABEL_MAX_LENGTH = 60

Properties

$includeFeedback

private bool $includeFeedback = false

$includeVirtual

private bool $includeVirtual = false

Methods

getProcessedHelp()

Override default help message.

public getProcessedHelp() : string
Return values
string

notification()

Send desktop notification.

public notification(string $body[, string|null $url = null ]) : void
Parameters
$body : string
$url : string|null = null

run()

{@inheritdoc}

public run(InputInterface $input, OutputInterface $output) : int
Parameters
$input : InputInterface
$output : OutputInterface
Return values
int

validateUrl()

Validate URL.

public static validateUrl(string $url) : string
Parameters
$url : string
Tags
throws
RuntimeException
Return values
string

binName()

Returns the "binary name" in the console context.

protected binName() : string
Return values
string

configure()

{@inheritdoc}

protected configure() : mixed

execute()

{@inheritdoc}

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

getBuilder()

Creates or returns a Builder instance.

protected getBuilder([array<string|int, mixed> $config = [] ]) : Builder
Parameters
$config : array<string|int, mixed> = []
Tags
throws
RuntimeException
Return values
Builder

getConfigFiles()

Returns config file(s) path.

protected getConfigFiles() : array<string|int, mixed>
Return values
array<string|int, mixed>

getPath()

Returns the working path.

protected getPath([bool $exist = true ]) : string|null
Parameters
$exist : bool = true
Return values
string|null

initialize()

{@inheritdoc}

protected initialize(InputInterface $input, OutputInterface $output) : mixed
Parameters
$input : InputInterface
$output : OutputInterface

locateAdditionalConfigFiles()

Locates additional configuration file(s) from the given list of files, relative to the given path or absolute.

protected locateAdditionalConfigFiles(string $path, string $configFilesList) : array<string|int, mixed>
Parameters
$path : string
$configFilesList : string
Return values
array<string|int, mixed>

locateConfigFile()

Locates the configuration in the given path, as an array of the file name and path, if file exists, otherwise default name and false.

protected locateConfigFile(string $path) : array<string|int, mixed>
Parameters
$path : string
Return values
array<string|int, mixed>

openEditor()

Opens path with editor.

protected openEditor(string $path, string $editor) : void
Parameters
$path : string
$editor : string
Tags
throws
RuntimeException

buildFilteredResult()

private buildFilteredResult(array{summary: array{pages_audited: int, pages_without_findings: int, bad_count: int, ok_count: int, feedback_count: int}, findings: array$result, array<int, array{page: string, level: string, check: string, details: string}> $findings) : array{summary: array{pages_audited: int, pages_without_findings: int, bad_count: int, ok_count: int, feedback_count: int}, findings: array}
Parameters
$result : array{summary: array{pages_audited: int, pages_without_findings: int, bad_count: int, ok_count: int, feedback_count: int}, findings: array}
$findings : array<int, array{page: string, level: string, check: string, details: string}>
Return values
array{summary: array{pages_audited: int, pages_without_findings: int, bad_count: int, ok_count: int, feedback_count: int}, findings: array}

filterResultWithoutLevel()

private filterResultWithoutLevel(array{summary: array{pages_audited: int, pages_without_findings: int, bad_count: int, ok_count: int, feedback_count: int}, findings: array$result, string $level) : array{summary: array{pages_audited: int, pages_without_findings: int, bad_count: int, ok_count: int, feedback_count: int}, findings: array}
Parameters
$result : array{summary: array{pages_audited: int, pages_without_findings: int, bad_count: int, ok_count: int, feedback_count: int}, findings: array}
$level : string
Return values
array{summary: array{pages_audited: int, pages_without_findings: int, bad_count: int, ok_count: int, feedback_count: int}, findings: array}

formatLevel()

private formatLevel(string $level) : string
Parameters
$level : string
Return values
string

outputJson()

Output results in JSON format.

private outputJson(OutputInterface $output, array<string|int, mixed> $result) : void
Parameters
$output : OutputInterface
$result : array<string|int, mixed>

outputText()

Output results in text format (tables).

private outputText(OutputInterface $output, array<string|int, mixed> $result) : void
Parameters
$output : OutputInterface
$result : array<string|int, mixed>

truncatePageLabel()

private truncatePageLabel(string $page) : string
Parameters
$page : string
Return values
string
On this page

Search results