MediaWiki master
MediaWiki\Parser\Parsoid\LintErrorChecker Class Reference

Check arbitrary wikitext for lint errors. More...

Public Member Functions

 __construct (private readonly Parsoid $parsoid, private readonly PageConfigFactory $pageConfigFactory, private readonly TitleFactory $titleFactory, private readonly ExtensionRegistry $extensionRegistry, private readonly Config $mainConfig,)
 
 check (RevisionRecord|string $revision)
 Check the given wikitext for lint errors.
 
 checkSome (RevisionRecord|string $revision, array $disabled)
 Check the given wikitext for lint errors against a subset of lint categories.
 

Detailed Description

Check arbitrary wikitext for lint errors.

Since
1.43

Definition at line 23 of file LintErrorChecker.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Parser\Parsoid\LintErrorChecker::__construct ( private readonly Parsoid $parsoid,
private readonly PageConfigFactory $pageConfigFactory,
private readonly TitleFactory $titleFactory,
private readonly ExtensionRegistry $extensionRegistry,
private readonly Config $mainConfig )

Definition at line 24 of file LintErrorChecker.php.

Member Function Documentation

◆ check()

MediaWiki\Parser\Parsoid\LintErrorChecker::check ( RevisionRecord|string $revision)

Check the given wikitext for lint errors.

While not strictly required, you'll get better results if the wikitext has already gone through PST

Parameters
RevisionRecord | string$revisionRevision containing wikitext after PST
Returns
array Array of error objects returned by Parsoid's lint API (empty array for no errors)
Note
Passing a string as $revision is deprecated since 1.47 and will emit warnings. Use MutableRevisionRecord::newFromContent() to pass a WikitextContent constructed with your string.

Definition at line 57 of file LintErrorChecker.php.

◆ checkSome()

MediaWiki\Parser\Parsoid\LintErrorChecker::checkSome ( RevisionRecord|string $revision,
array $disabled )

Check the given wikitext for lint errors against a subset of lint categories.

While not strictly required, you'll get better results if the wikitext has already gone through PST

Parameters
RevisionRecord | string$revisionRevision containing wikitext after PST
string[]$disabledArray of lint categories to disable
Returns
array Array of error objects returned by Parsoid's lint API (empty array for no errors)
Note
Passing a string as $revision is deprecated since 1.47 and will emit warnings. Use MutableRevisionRecord::newFromContent() to pass a WikitextContent constructed with your string.

Definition at line 73 of file LintErrorChecker.php.

References wfDeprecatedMsg().


The documentation for this class was generated from the following file: