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: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"require": {
"php": ">=8.0",
"guzzlehttp/guzzle": "^7.5.0",
"firebase/php-jwt": "^v6.4.0"
"firebase/php-jwt": "^v7.0.2"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.14.0",
Expand Down
4 changes: 2 additions & 2 deletions lib/GetStream/Stream/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function setLocation($location)
* @param ?array $extra_data
* @return string
*/
public function createUserSessionToken($user_id, array $extra_data=null)
public function createUserSessionToken($user_id, ?array $extra_data=null)
{
if (is_null($extra_data)) {
$extra_data = [];
Expand All @@ -145,7 +145,7 @@ public function createUserSessionToken($user_id, array $extra_data=null)
* @param ?array $extra_data
* @return string
*/
public function createUserToken($user_id, array $extra_data=null)
public function createUserToken($user_id, ?array $extra_data=null)
{
if (is_null($extra_data)) {
$extra_data = [];
Expand Down
4 changes: 2 additions & 2 deletions lib/GetStream/Stream/ClientInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ public function getCustomHttpHandlerStack();
* @param ?array $extra_data
* @return string
*/
public function createUserSessionToken($user_id, array $extra_data = null);
public function createUserSessionToken($user_id, ?array $extra_data = null);

/**
* @param string $user_id
* @param ?array $extra_data
* @return string
*/
public function createUserToken($user_id, array $extra_data = null);
public function createUserToken($user_id, ?array $extra_data = null);

/**
* @param BaseFeedInterface $feed
Expand Down
8 changes: 4 additions & 4 deletions lib/GetStream/Stream/Reactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private function doRequest($method, $endpoint, $params=null)
*
* @return array
*/
public function add($kind, $activityId, $userId, array $data=null, array $targetFeeds=null, $targetFeedsExtraData=null)
public function add($kind, $activityId, $userId, ?array $data=null, ?array $targetFeeds=null, $targetFeedsExtraData=null)
{
$payload = [
'kind' => $kind,
Expand Down Expand Up @@ -102,7 +102,7 @@ public function add($kind, $activityId, $userId, array $data=null, array $target
*
* @return array
*/
public function addChild($kind, $parentId, $userId, array $data=null, array $targetFeeds=null, $targetFeedsExtraData=null)
public function addChild($kind, $parentId, $userId, ?array $data=null, ?array $targetFeeds=null, $targetFeedsExtraData=null)
{
$payload = [
'kind' => $kind,
Expand Down Expand Up @@ -170,7 +170,7 @@ public function restore($reactionId)
*
* @return array
*/
public function filter($lookupField, $lookupValue, $kind=null, array $params=null)
public function filter($lookupField, $lookupValue, $kind=null, ?array $params=null)
{
if (!in_array($lookupField, ["reaction_id", "activity_id", "user_id"])) {
throw new StreamFeedException("Invalid request parameters");
Expand Down Expand Up @@ -205,7 +205,7 @@ public function get($reactionId)
*
* @return array
*/
public function update($reactionId, array $data=null, array $targetFeeds=null, $targetFeedsExtraData=null)
public function update($reactionId, ?array $data=null, ?array $targetFeeds=null, $targetFeedsExtraData=null)
{
$payload = [];
if ($data !== null) {
Expand Down
4 changes: 2 additions & 2 deletions lib/GetStream/Stream/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private function doRequest($method, $endpoint, $params=null)
*
* @return array
*/
public function add($userId, array $data=null, $getOrCreate=null)
public function add($userId, ?array $data=null, $getOrCreate=null)
{
$endpoint = 'user/';
$payload = [
Expand Down Expand Up @@ -126,7 +126,7 @@ public function get($userId)

* @return array
*/
public function update($userId, array $data=null)
public function update($userId, ?array $data=null)
{
$payload = [];
if ($data !== null) {
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,21 @@ public function testClientSigning()

public function testClientFeed()
{
$client = new Client('key', 'secret', $location='qa');
$client = new Client('key', str_repeat('s', 32), $location='qa');
$feed1 = $client->feed('flat', '1');
$this->assertSame($feed1->getId(), 'flat:1');
}

public function testCreateReference()
{
$client = new Client('key', 'secret', $location='qa');
$client = new Client('key', str_repeat('s', 32), $location='qa');
$ref = $client->collections()->createReference("item", "42");
$this->assertEquals($ref, "SO:item:42");
}

public function testCreateUserReference()
{
$client = new Client('key', 'secret', $location='qa');
$client = new Client('key', str_repeat('s', 32), $location='qa');
$ref = $client->users()->createReference("42");
$this->assertEquals($ref, "SU:42");
}
Expand Down
Loading