Skip to content

Commit

Permalink
Update FixLinksController.php
Browse files Browse the repository at this point in the history
  • Loading branch information
WinterSilence authored Jun 15, 2022
1 parent 2ee3ccc commit b851ff6
Showing 1 changed file with 32 additions and 5 deletions.
37 changes: 32 additions & 5 deletions build/controllers/FixLinksController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
* @since 2.0.46
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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).
*
Expand Down

0 comments on commit b851ff6

Please sign in to comment.