Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit test for ReturnTypeHintSniff
- Loading branch information
1 parent
c0078d3
commit 3ae15c2
Showing
3 changed files
with
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
namespace Beakman; | ||
|
||
class Foo | ||
{ | ||
/** | ||
* @return $this | ||
*/ | ||
public function correct() | ||
{ | ||
} | ||
|
||
/** | ||
* @return $this | ||
*/ | ||
public function incorrect(): Foo | ||
{ | ||
} | ||
|
||
/** | ||
* @return $this | ||
*/ | ||
public function incorrectSelf(): self | ||
{ | ||
} | ||
} |
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,28 @@ | ||
<?php | ||
|
||
namespace CakePHP\Tests\Classes; | ||
|
||
use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; | ||
|
||
class ReturnTypeHintUnitTest extends AbstractSniffUnitTest | ||
{ | ||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getErrorList() | ||
{ | ||
return [ | ||
16 => 1, | ||
23 => 1, | ||
]; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getWarningList() | ||
{ | ||
return [ | ||
]; | ||
} | ||
} |
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,29 @@ | ||
<?php | ||
namespace Beakman; | ||
|
||
use Other\Crap; | ||
use Other\Error as OtherError; | ||
|
||
class Foo | ||
{ | ||
/** | ||
* @return $this | ||
*/ | ||
public function correct() | ||
{ | ||
} | ||
|
||
/** | ||
* @return $this | ||
*/ | ||
public function incorrect(): Foo | ||
{ | ||
} | ||
|
||
/** | ||
* @return $this | ||
*/ | ||
public function incorrectSelf() | ||
{ | ||
} | ||
} |