Skip to content

Commit

Permalink
cs
Browse files Browse the repository at this point in the history
  • Loading branch information
felixdorn committed May 26, 2021
1 parent d8e80d6 commit e601924
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ protected static function ensureHttpClientIsLoaded(): TwitterClient
public static function all(): array
{
$rules = static::ensureHttpClientIsLoaded()->request('GET', 'https://api.twitter.com/2/tweets/search/stream/rules');

return array_map(static function ($rawRule) {
$rule = new self($rawRule['value'], $rawRule['tag']);
$rule->withId($rawRule['id']);
Expand Down
1 change: 1 addition & 0 deletions src/RuleBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ public function raw(string $expression): static
public function save(string $tag = null): Rule
{
$compiled = $this->compile();

return Rule::create($compiled, $tag ?? $compiled);
}
}
7 changes: 3 additions & 4 deletions src/TwitterStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function filteredTweets(Sets $sets = null): Generator
};

while ($shouldKeepListening()) {
$char = $this->streamConnection->read(1) ;
$char = $this->streamConnection->read(1);
$tweet = $char;

while ($char !== "\n" && $tweet[-1] !== "\r") {
Expand Down Expand Up @@ -67,11 +67,10 @@ protected function connectToFilteredStream(Sets $sets = null): StreamInterface

public function __destruct()
{
// If the connection was never initialized, this throws an error.
// If the connection was never initialized, this throws an error.
try {
$this->stopListening();
$this->stopListening();
} catch (Error) {

}
}

Expand Down

0 comments on commit e601924

Please sign in to comment.