Skip to content

Commit

Permalink
Fix static code analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
nkl-kst committed Jun 25, 2024
1 parent b715e1d commit f7c547d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/Entity/BcPropertiesTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

trait BcPropertiesTrait
{
public function __get($name)
/**
* @return mixed
*/
public function __get(string $name)
{
// Check for BC properties
if (in_array($name, array_keys(self::BC_PROPERTIES), true)) {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/BC/BcTestUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static function checkBcProperty(object $entity, string $bcProperty): void

// TODO: How to check if PHP Deprecated has been raised (https://github.com/sebastianbergmann/phpunit/issues/5062#issuecomment-1420379762)?
$docComment = (new \ReflectionClass($entity))->getDocComment();
$docComment = (new \ReflectionClass($entity))->getDocComment() ?: 'no comment';
TestCase::assertMatchesRegularExpression(
sprintf('/@property .* \$%s/', $bcProperty),
$docComment,
Expand Down
3 changes: 3 additions & 0 deletions test/unit/BC/TeamBcTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ protected function setUp(): void
$this->team = $teamSerializer->serialize($teamJson)[0];
}

/**
* @return array<string[]>
*/
public static function provideBcProperties(): array
{
return [
Expand Down

0 comments on commit f7c547d

Please sign in to comment.