isset($map->email) && is_string($map->email) ? mb_strtolower($map->email) : '', 'name' => isset($map->name) && is_string($map->name) ? $map->name : '', 'username' => isset($map->username) && is_string($map->username) ? $map->username : '' ]); } /** * Converts this object to a map in JSON format. * @return \stdClass The map in JSON format corresponding to this object. */ function jsonSerialize(): \stdClass { return (object) [ 'after' => $this->getAfter(), 'before' => $this->getBefore(), 'compare_url' => ($url = $this->getCompareUrl()) ? (string) $url : null, 'commits' => array_map(function(PayloadCommit $commit) { return $commit->jsonSerialize(); }, $this->getCommits()->getArrayCopy()), 'pusher', 'ref' => $this->getRef(), 'repository', 'sender' ]; } }