Skip to content

Commit 6fec00f

Browse files
committed
minor #76 add some missing type hints (xabbuh)
This PR was merged into the 3.0.x-dev branch. Discussion ---------- add some missing type hints Commits ------- 84fd013 add some missing type hints
2 parents 4759d2a + 84fd013 commit 6fec00f

File tree

3 files changed

+27
-32
lines changed

3 files changed

+27
-32
lines changed

src/Person.php

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,8 @@ private function __construct()
4949

5050
/**
5151
* @param Agent[] $agents
52-
*
53-
* @return $this
5452
*/
55-
public static function createFromAgents(array $agents)
53+
public static function createFromAgents(array $agents): self
5654
{
5755
$person = new self();
5856

@@ -83,27 +81,42 @@ public static function createFromAgents(array $agents)
8381
return $person;
8482
}
8583

86-
public function getNames()
84+
/**
85+
* @return string[]
86+
*/
87+
public function getNames(): array
8788
{
8889
return $this->names;
8990
}
9091

91-
public function getMboxes()
92+
/**
93+
* @return IRI[]
94+
*/
95+
public function getMboxes(): array
9296
{
9397
return $this->mboxes;
9498
}
9599

96-
public function getMboxSha1Sums()
100+
/**
101+
* @return string[]
102+
*/
103+
public function getMboxSha1Sums(): array
97104
{
98105
return $this->mboxSha1Sums;
99106
}
100107

101-
public function getOpenIds()
108+
/**
109+
* @return string[]
110+
*/
111+
public function getOpenIds(): array
102112
{
103113
return $this->openIds;
104114
}
105115

106-
public function getAccounts()
116+
/**
117+
* @return Account[]
118+
*/
119+
public function getAccounts(): array
107120
{
108121
return $this->accounts;
109122
}

src/State.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,8 @@ public function getActor(): Actor
5757

5858
/**
5959
* Returns the agent.
60-
*
61-
* @return Actor The agent
6260
*/
63-
public function getAgent()
61+
public function getAgent(): Agent
6462
{
6563
return $this->actor;
6664
}

src/StateDocumentsFilter.php

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,8 @@ class StateDocumentsFilter
2525

2626
/**
2727
* Filter by an Activity.
28-
*
29-
* @param Activity $activity The Activity to filter by
30-
*
31-
* @return $this
3228
*/
33-
public function byActivity(Activity $activity)
29+
public function byActivity(Activity $activity): self
3430
{
3531
$this->filter['activity'] = $activity->getId()->getValue();
3632

@@ -39,12 +35,8 @@ public function byActivity(Activity $activity)
3935

4036
/**
4137
* Filters by an Agent.
42-
*
43-
* @param Agent $agent The Agent to filter by
44-
*
45-
* @return $this
4638
*/
47-
public function byAgent(Agent $agent)
39+
public function byAgent(Agent $agent): self
4840
{
4941
$this->filter['agent'] = $agent;
5042

@@ -53,12 +45,8 @@ public function byAgent(Agent $agent)
5345

5446
/**
5547
* Filters for State documents matching the given registration id.
56-
*
57-
* @param string $registration A registration id
58-
*
59-
* @return $this
6048
*/
61-
public function byRegistration($registration)
49+
public function byRegistration(string $registration): self
6250
{
6351
$this->filter['registration'] = $registration;
6452

@@ -67,12 +55,8 @@ public function byRegistration($registration)
6755

6856
/**
6957
* Filters for State documents stored since the specified timestamp (exclusive).
70-
*
71-
* @param \DateTime $timestamp The timestamp
72-
*
73-
* @return $this
7458
*/
75-
public function since(\DateTime $timestamp)
59+
public function since(\DateTime $timestamp): self
7660
{
7761
$this->filter['since'] = $timestamp->format('c');
7862

@@ -84,7 +68,7 @@ public function since(\DateTime $timestamp)
8468
*
8569
* @return array The filter
8670
*/
87-
public function getFilter()
71+
public function getFilter(): array
8872
{
8973
return $this->filter;
9074
}

0 commit comments

Comments
 (0)