diff --git a/CHANGELOG.md b/CHANGELOG.md index 05db78a..743bf59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,15 @@ and [Keep a Changelog](http://keepachangelog.com/). * Added semi-linear merge recommendation to GOVERNANCE.md ([#130]) * Added GitHub Action to enforce updates to CHANGELOG.md ([#131]) +_The following entry is a backwards incompatible API change +and may require changes in applications that invoke these methods:_ + +* Error return values for `WikiPage::getSection()` changed from `false` to `null` ([#129]) + +#### Fixed + +* Fixed one error return value in `WikiPage::setText()` ([#129]) + #### Removed * Method `Wikimate::debugCurlConfig()`, deprecated since v0.10.0 ([#128]) @@ -170,5 +179,6 @@ and [Keep a Changelog](http://keepachangelog.com/). [#125]: https://github.com/hamstar/Wikimate/pull/125 [#127]: https://github.com/hamstar/Wikimate/pull/127 [#128]: https://github.com/hamstar/Wikimate/pull/128 +[#129]: https://github.com/hamstar/Wikimate/pull/129 [#130]: https://github.com/hamstar/Wikimate/pull/130 [#131]: https://github.com/hamstar/Wikimate/pull/131 diff --git a/Wikimate.php b/Wikimate.php index 31b28bb..ee9ba3d 100644 --- a/Wikimate.php +++ b/Wikimate.php @@ -1145,20 +1145,20 @@ public function getText($refresh = false) * true to include heading too * @param boolean $includeSubsections False to get section text only, * true to include subsections too - * @return string Wikitext of the section on the page, - * or false if section is undefined + * @return mixed Wikitext of the section on the page, + * or null if section is undefined */ public function getSection($section, $includeHeading = false, $includeSubsections = true) { // Check if we have a section name or index if (is_int($section)) { if (!isset($this->sections->byIndex[$section])) { - return false; + return null; } $coords = $this->sections->byIndex[$section]; } else if (is_string($section)) { if (!isset($this->sections->byName[$section])) { - return false; + return null; } $coords = $this->sections->byName[$section]; } @@ -1308,7 +1308,7 @@ public function setText($text, $section = null, $minor = false, $summary = null) // Check for errors if (isset($r['error'])) { $this->error = $r['error']; // Set the error if there was one - return null; + return false; } else { $this->error = null; // Reset the error status }