Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and may require changes in applications that invoke these methods:_
#### Fixed

* Fixed one error return value in `WikiPage::setText()` ([#129])
* Fixed exception type/message for `$keyNames` parameter to `WikiPage::getAllSections()` ([#133])

#### Removed

Expand Down Expand Up @@ -184,3 +185,4 @@ and may require changes in applications that invoke these methods:_
[#130]: https://github.com/hamstar/Wikimate/pull/130
[#131]: https://github.com/hamstar/Wikimate/pull/131
[#132]: https://github.com/hamstar/Wikimate/pull/132
[#133]: https://github.com/hamstar/Wikimate/pull/133
2 changes: 1 addition & 1 deletion USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Array
)
```

An Exception is thrown if an unsupported value is supplied for the $keyNames parameter.
An `UnexpectedValueException` is thrown if an unsupported value is supplied for the `$keyNames` parameter.

#### Writing...

Expand Down
6 changes: 3 additions & 3 deletions Wikimate.php
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ public function __construct($title, $wikimate)
{
$this->wikimate = $wikimate;
$this->title = $title;
$this->sections = new stdClass();
$this->sections = new \stdClass();
$this->text = $this->getText(true);

if ($this->invalid) {
Expand Down Expand Up @@ -1206,7 +1206,7 @@ public function getSection($section, $includeHeading = false, $includeSubsection
* @param boolean $includeHeading False to get section text only
* @param integer $keyNames Modifier for the array key names
* @return array Array of sections
* @throw Exception If $keyNames is not a supported constant
* @throw UnexpectedValueException If $keyNames is not a supported constant
*/
public function getAllSections($includeHeading = false, $keyNames = self::SECTIONLIST_BY_INDEX)
{
Expand All @@ -1220,7 +1220,7 @@ public function getAllSections($includeHeading = false, $keyNames = self::SECTIO
$array = array_keys($this->sections->byName);
break;
default:
throw new Exception('Unexpected parameter $keyNames given to WikiPage::getAllSections()');
throw new \UnexpectedValueException("Unexpected keyNames parameter ($keyNames) passed to WikiPage::getAllSections()");
break;
}

Expand Down