-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for
@phpstan-require-extends
and `@phpstan-require-im…
…plements` PHPDoc tags
- Loading branch information
Showing
7 changed files
with
270 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace PHPStan\PhpDocParser\Ast\PhpDoc; | ||
|
||
use PHPStan\PhpDocParser\Ast\NodeAttributes; | ||
use PHPStan\PhpDocParser\Ast\Type\TypeNode; | ||
use function trim; | ||
|
||
class RequireExtendsTagValueNode implements PhpDocTagValueNode | ||
{ | ||
|
||
use NodeAttributes; | ||
|
||
/** @var TypeNode */ | ||
public $type; | ||
|
||
/** @var string (may be empty) */ | ||
public $description; | ||
|
||
public function __construct(TypeNode $type, string $description) | ||
{ | ||
$this->type = $type; | ||
$this->description = $description; | ||
} | ||
|
||
|
||
public function __toString(): string | ||
{ | ||
return trim("{$this->type} {$this->description}"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace PHPStan\PhpDocParser\Ast\PhpDoc; | ||
|
||
use PHPStan\PhpDocParser\Ast\NodeAttributes; | ||
use PHPStan\PhpDocParser\Ast\Type\TypeNode; | ||
use function trim; | ||
|
||
class RequireImplementsTagValueNode implements PhpDocTagValueNode | ||
{ | ||
|
||
use NodeAttributes; | ||
|
||
/** @var TypeNode */ | ||
public $type; | ||
|
||
/** @var string (may be empty) */ | ||
public $description; | ||
|
||
public function __construct(TypeNode $type, string $description) | ||
{ | ||
$this->type = $type; | ||
$this->description = $description; | ||
} | ||
|
||
|
||
public function __toString(): string | ||
{ | ||
return trim("{$this->type} {$this->description}"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters