Force arrays in constructors of ActivityStreamJSONDocument and JSONActivityCollection

Started using PHP7+ and it started complaining about count() being fed objects
that weren't "Countable". .)
This commit is contained in:
Mikael Nordfeldth
2017-07-10 14:26:01 +02:00
parent 31866be98b
commit a7df79ac07
2 changed files with 4 additions and 6 deletions

View File

@@ -27,10 +27,7 @@
* @link http://status.net/
*/
if (!defined('STATUSNET'))
{
exit(1);
}
if (!defined('GNUSOCIAL')) { exit(1); }
/**
* A class for generating JSON documents that represent an Activity Streams
@@ -72,7 +69,7 @@ class ActivityStreamJSONDocument extends JSONActivityCollection
* @param User $cur the current authenticated user
*/
function __construct($cur = null, $title = null, $items = null, $links = null, $url = null)
function __construct($cur = null, $title = null, array $items=[], $links = null, $url = null)
{
parent::__construct($items, $url);