From b851ff6219efb81d2c6cf77e0bc4e50cccb23fd0 Mon Sep 17 00:00:00 2001 From: Anton Date: Wed, 15 Jun 2022 15:07:14 +0300 Subject: [PATCH] Update FixLinksController.php --- build/controllers/FixLinksController.php | 37 ++++++++++++++++++++---- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/build/controllers/FixLinksController.php b/build/controllers/FixLinksController.php index 5d586fd7704..f1fa06b7503 100644 --- a/build/controllers/FixLinksController.php +++ b/build/controllers/FixLinksController.php @@ -15,9 +15,9 @@ use Yii; /** - * Replaces outdated links(3xx response codes) add display removed links(4xx response codes). + * Replaces outdated links (3xx response codes) add display removed links (4xx response codes). * - * This method scan PHP sources(DocBlock) and documentation(Markdown). + * This method scan PHP sources (DocBlock) and documentation (Markdown). * * @author Anton Fedonyuk * @since 2.0.46 @@ -32,7 +32,7 @@ class FixLinksController extends Controller /** * @var bool the "safe mode" option: output outdated links instead of replacing them in files */ - public $safeMode = false; + public $safeMode = true; /** * @inheritDoc @@ -41,9 +41,9 @@ public function options($actionID) { return \array_merge(parent::options($actionID), ['safeMode']); } - + /** - * Replaces updated links add log removed links. + * Replaces outdated links add log removed links. * * @return int * @throws \yii\base\InvalidConfigException @@ -57,6 +57,33 @@ public function actionIndex() return ExitCode::OK; } + /** + * Replaces outdated links add log removed links in PHP sources (DocBlock). + * + * @return int + * @throws \yii\base\InvalidConfigException + */ + public function actionSources() + { + $this->linkChecker = new LinkChecker(); + $this->fixSources(); + + return ExitCode::OK; + } + /** + * Replaces outdated links add log removed links in Markdown documentation. + * + * @return int + * @throws \yii\base\InvalidConfigException + */ + public function actionDocs() + { + $this->linkChecker = new LinkChecker(); + $this->fixDocs(); + + return ExitCode::OK; + } + /** * Fix outdated links in PHP sources(DocBlock). *