Skip to content

Commit b5f9ec4

Browse files
Fix docblocks
1 parent f257df2 commit b5f9ec4

File tree

3 files changed

+53
-5
lines changed

3 files changed

+53
-5
lines changed

src/GetStream/StreamLaravel/Eloquent/ActivityTrait.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ public function activityActorId()
6060

6161
/**
6262
* The reference to the model instance of the author/owner
63-
* @return object \Illuminate\Database\Eloquent\Model instance
63+
*
64+
* @return string
6465
*/
6566
public function activityActor()
6667
{
@@ -80,6 +81,7 @@ public function activityVerb()
8081

8182
/**
8283
* The activity object for this instance
84+
*
8385
* @return string
8486
*/
8587
public function activityObject()
@@ -89,6 +91,7 @@ public function activityObject()
8991

9092
/**
9193
* The activity foreign_id for this instance
94+
*
9295
* @return string
9396
*/
9497
public function activityForeignId()
@@ -98,6 +101,7 @@ public function activityForeignId()
98101

99102
/**
100103
* The activity time for this instance
104+
*
101105
* @return string
102106
*/
103107
public function activityTime()
@@ -107,7 +111,8 @@ public function activityTime()
107111

108112
/**
109113
* The feeds that should receive a copy of this instance when it's created
110-
* @return GetStream\Stream\Feed[]
114+
*
115+
* @return \GetStream\Stream\Feed[]
111116
*/
112117
public function activityNotify()
113118
{
@@ -116,7 +121,8 @@ public function activityNotify()
116121

117122
/**
118123
* The activity data for this instance
119-
* @return array[string]string
124+
*
125+
* @return array
120126
*/
121127
public function createActivity()
122128
{

src/GetStream/StreamLaravel/Eloquent/CreateRemoveObserver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ class CreateRemoveObserver
88
{
99
public function created($model)
1010
{
11-
$manager = \App::make('feed_manager');
11+
$manager = App::make('feed_manager');
1212
$manager->activityCreated($model);
1313
}
1414

1515
public function deleting($model)
1616
{
17-
$manager = \App::make('feed_manager');
17+
$manager = App::make('feed_manager');
1818
$manager->activityDeleted($model);
1919
}
2020
}

src/GetStream/StreamLaravel/StreamLaravelManager.php

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,28 @@ class StreamLaravelManager
1111
* @var Client
1212
*/
1313
public $client;
14+
15+
/**
16+
* @var mixed
17+
*/
1418
private $config;
1519

20+
/**
21+
* @var string
22+
*/
23+
private $userFeed;
24+
25+
/**
26+
* @param string $api_key
27+
* @param string $api_secret
28+
* @param mixed $config
29+
*
30+
* @throws Exception
31+
*/
1632
public function __construct($api_key, $api_secret, $config)
1733
{
1834
$this->config = $config;
35+
1936
if (getenv('STREAM_URL') !== false) {
2037
$this->client = Client::herokuConnect(getenv('STREAM_URL'));
2138
} else {
@@ -27,17 +44,32 @@ public function __construct($api_key, $api_secret, $config)
2744
$this->userFeed = $this->config->get("stream-laravel::user_feed");
2845
}
2946

47+
/**
48+
* @param string $user_id
49+
*
50+
* @return \GetStream\Stream\Feed
51+
*/
3052
public function getUserFeed($user_id)
3153
{
3254
return $this->client->feed($this->userFeed, $user_id);
3355
}
3456

57+
/**
58+
* @param string $user_id
59+
*
60+
* @return \GetStream\Stream\Feed
61+
*/
3562
public function getNotificationFeed($user_id)
3663
{
3764
$user_feed = $this->config->get("stream-laravel::notification_feed");
3865
return $this->client->feed($user_feed, $user_id);
3966
}
4067

68+
/**
69+
* @param string $user_id
70+
*
71+
* @return array
72+
*/
4173
public function getNewsFeeds($user_id)
4274
{
4375
$feeds = [];
@@ -48,19 +80,29 @@ public function getNewsFeeds($user_id)
4880
return $feeds;
4981
}
5082

83+
/**
84+
* @param string $user_id
85+
* @param string $target_user_id
86+
*/
5187
public function followUser($user_id, $target_user_id)
5288
{
5389
$news_feeds = $this->getNewsFeeds($user_id);
5490
$target_feed = $this->getUserFeed($target_user_id);
91+
5592
foreach ($news_feeds as $feed) {
5693
$feed->followFeed($target_feed->getSlug(), $target_feed->getUserId());
5794
}
5895
}
5996

97+
/**
98+
* @param string $user_id
99+
* @param string $target_user_id
100+
*/
60101
public function unfollowUser($user_id, $target_user_id)
61102
{
62103
$news_feeds = $this->getNewsFeeds($user_id);
63104
$target_feed = $this->getUserFeed($target_user_id);
105+
64106
foreach ($news_feeds as $feed) {
65107
$feed->unfollowFeed($target_feed->getSlug(), $target_feed->getUserId());
66108
}

0 commit comments

Comments
 (0)