Skip to content

Commit

Permalink
Improved return type for fluent methods
Browse files Browse the repository at this point in the history
  • Loading branch information
wouterj authored Feb 8, 2020
1 parent d1892f1 commit 496ecff
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ public function hasAttribute(string $key): bool

/**
* @param mixed $value
*
* @return $this
*/
public function setAttribute(string $key, $value): self
{
Expand All @@ -139,6 +141,9 @@ final protected function assertMutable(): void
throw new LogicException('This context was already initialized and is immutable; you cannot modify it anymore.');
}

/**
* @return $this
*/
public function addExclusionStrategy(ExclusionStrategyInterface $strategy): self
{
$this->assertMutable();
Expand All @@ -161,6 +166,9 @@ public function addExclusionStrategy(ExclusionStrategyInterface $strategy): self
return $this;
}

/**
* @return $this
*/
public function setVersion(string $version): self
{
$this->attributes['version'] = $version;
Expand All @@ -170,6 +178,8 @@ public function setVersion(string $version): self

/**
* @param array|string $groups
*
* @return $this
*/
public function setGroups($groups): self
{
Expand All @@ -182,6 +192,9 @@ public function setGroups($groups): self
return $this;
}

/**
* @return $this
*/
public function enableMaxDepthChecks(): self
{
$this->attributes['max_depth_checks'] = true;
Expand Down

0 comments on commit 496ecff

Please sign in to comment.