Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
felixdorn committed Apr 21, 2023
1 parent 69bd8f8 commit cc9e488
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/RuleManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function all(): array
{
$rules = $this->connection->request('GET', 'https://api.twitter.com/2/tweets/search/stream/rules');

return array_map(fn (array $rule) => new Rule(
return array_map(fn(array $rule) => new Rule(
$rule['value'],
$rule['tag'] ?? null,
$rule['id'] ?? null,
Expand All @@ -23,9 +23,9 @@ public function all(): array
/**
* @deprecated Use delete() instead
*/
public function deleteMany(Rule|string|array $id): TwitterResponse
public function deleteMany(Rule|string|array $ids): TwitterResponse
{
return $this->delete($id);
return $this->delete($ids);
}

/** @param string|string[]|Rule[] $ids */
Expand All @@ -39,8 +39,9 @@ public function delete(Rule|string|array $ids): ?TwitterResponse
return null;
}


$ids = array_filter(
array_map(fn ($id) => $id instanceof Rule ? $id->id : $id, $ids)
array_map(fn($id) => $id instanceof Rule ? $id->id : $id, $ids)
);

return $this->connection->request('POST', 'https://api.twitter.com/2/tweets/search/stream/rules', [
Expand Down Expand Up @@ -76,7 +77,7 @@ public function saveMany(array $rules, bool $dryRun = false): TwitterResponse

return $this->connection->request('POST', 'https://api.twitter.com/2/tweets/search/stream/rules' . $dryRun, [
'body' => [
'add' => array_map(fn ($rule) => ['value' => $rule->value, 'tag' => $rule->tag], $rules),
'add' => array_map(fn($rule) => ['value' => $rule->value, 'tag' => $rule->tag], $rules),
],
]);
}
Expand Down

0 comments on commit cc9e488

Please sign in to comment.