// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
// SPDX-License-Identifier: BSD-3-Clause
* Manages all category-related data
* Used by {@see \SimplePie\Item::get_category()} and {@see \SimplePie\Item::get_categories()}
* This class can be overloaded with {@see \SimplePie\SimplePie::set_category_class()}
* Categorization scheme identifier
* category for <category>
* subject for <dc:subject>
* Constructor, used to input the data
* @param string|null $term
* @param string|null $scheme
* @param string|null $label
* @param string|null $type
public function __construct(?string $term = null, ?string $scheme = null, ?string $label = null, ?string $type = null)
public function __toString()
// There is no $this->data here
return md5(serialize($this));
* Get the category identifier
public function get_term()
* Get the categorization scheme identifier
public function get_scheme()
* Get the human readable label
public function get_label(bool $strict = false)
if ($this->label === null && $strict !== true) {
return $this->get_term();
public function get_type()
class_alias('SimplePie\Category', 'SimplePie_Category');