Skip to content
Snippets Groups Projects
Commit a59c4998 authored by Demian Katz's avatar Demian Katz
Browse files

Make ParamBag Countable.

- Fixes PHP 7.2 compatibility.
parent e0bb671e
No related merge requests found
......@@ -41,7 +41,7 @@ namespace VuFindSearch;
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link https://vufind.org
*/
class ParamBag
class ParamBag implements \Countable
{
/**
* Parameters
......@@ -76,6 +76,16 @@ class ParamBag
return isset($this->params[$name]) ? $this->params[$name] : null;
}
/**
* Count parameters in internal array. Needed for Countable interface.
*
* @return int
*/
public function count()
{
return count($this->params);
}
/**
* Return true if the bag contains any value(s) for the specified parameter.
*
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment