Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return static instance on abstract class setters #200

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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