Skip to content

Commit

Permalink
Return static instance on abstract class setters
Browse files Browse the repository at this point in the history
Signed-off-by: Toon Verwerft <[email protected]>
  • Loading branch information
veewee committed Jun 17, 2024
1 parent 33dd0f2 commit 48e4b67
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
</file>
<file src="src/Generator/AbstractMemberGenerator.php">
<PossiblyUnusedReturnValue>
<code>AbstractMemberGenerator</code>
<code>AbstractMemberGenerator</code>
<code>AbstractMemberGenerator</code>
<code>AbstractMemberGenerator</code>
<code>static</code>
<code>static</code>
<code>static</code>
<code>static</code>
</PossiblyUnusedReturnValue>
<RedundantCastGivenDocblockType>
<code>(string) $name</code>
Expand Down
8 changes: 4 additions & 4 deletions src/Generator/AbstractGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct($options = [])

/**
* @param bool $isSourceDirty
* @return AbstractGenerator
* @return static
*/
public function setSourceDirty($isSourceDirty = true)
{
Expand All @@ -56,7 +56,7 @@ public function isSourceDirty()

/**
* @param string $indentation
* @return AbstractGenerator
* @return static
*/
public function setIndentation($indentation)
{
Expand All @@ -74,7 +74,7 @@ public function getIndentation()

/**
* @param ?string $sourceContent
* @return AbstractGenerator
* @return static
*/
public function setSourceContent($sourceContent)
{
Expand All @@ -93,7 +93,7 @@ public function getSourceContent()
/**
* @param array|Traversable $options
* @throws Exception\InvalidArgumentException
* @return AbstractGenerator
* @return static
*/
public function setOptions($options)
{
Expand Down
20 changes: 10 additions & 10 deletions src/Generator/AbstractMemberGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ abstract class AbstractMemberGenerator extends AbstractGenerator

/**
* @param int|int[] $flags
* @return AbstractMemberGenerator
* @return static
*/
public function setFlags($flags)
{
Expand All @@ -46,7 +46,7 @@ public function setFlags($flags)

/**
* @param int $flag
* @return AbstractMemberGenerator
* @return static
*/
public function addFlag($flag)
{
Expand All @@ -56,7 +56,7 @@ public function addFlag($flag)

/**
* @param int $flag
* @return AbstractMemberGenerator
* @return static
*/
public function removeFlag($flag)
{
Expand All @@ -66,7 +66,7 @@ public function removeFlag($flag)

/**
* @param bool $isAbstract
* @return AbstractMemberGenerator
* @return static
*/
public function setAbstract($isAbstract)
{
Expand All @@ -83,7 +83,7 @@ public function isAbstract()

/**
* @param bool $isInterface
* @return AbstractMemberGenerator
* @return static
*/
public function setInterface($isInterface)
{
Expand All @@ -100,7 +100,7 @@ public function isInterface()

/**
* @param bool $isFinal
* @return AbstractMemberGenerator
* @return static
*/
public function setFinal($isFinal)
{
Expand All @@ -117,7 +117,7 @@ public function isFinal()

/**
* @param bool $isStatic
* @return AbstractMemberGenerator
* @return static
*/
public function setStatic($isStatic)
{
Expand All @@ -134,7 +134,7 @@ public function isStatic()

/**
* @param string $visibility
* @return AbstractMemberGenerator
* @return static
*/
public function setVisibility($visibility)
{
Expand Down Expand Up @@ -173,7 +173,7 @@ public function getVisibility()

/**
* @param string $name
* @return AbstractMemberGenerator
* @return static
*/
public function setName($name)
{
Expand All @@ -192,7 +192,7 @@ public function getName()
/**
* @param DocBlockGenerator|string $docBlock
* @throws Exception\InvalidArgumentException
* @return AbstractMemberGenerator
* @return static
*/
public function setDocBlock($docBlock)
{
Expand Down

0 comments on commit 48e4b67

Please sign in to comment.