Skip to content

Commit

Permalink
* compact all phpdoc block comments with only one annotation into one…
Browse files Browse the repository at this point in the history
…-linear by regex replacing `\/\*\*\n\s+\* (@.+)\n\s+\*/` to `/** $1 */` @ be
  • Loading branch information
n0099 committed Oct 11, 2024
1 parent bf05a24 commit 7425b88
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 48 deletions.
4 changes: 1 addition & 3 deletions be/src/Entity/BlobResourceGetter.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ public static function protoBuf($value, string $protoBufClass): ?array
return \Safe\json_decode($protoBuf->serializeToJsonString(), assoc: true);
}

/**
* @param ?resource $value
*/
/** @param ?resource $value */
public static function resource($value): ?string
{
if ($value === null) {
Expand Down
4 changes: 1 addition & 3 deletions be/src/Entity/LatestReplier.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ public function getDisplayName(): ?string
return BlobResourceGetter::resource($this->displayName);
}

/**
* @param resource|null $displayName
*/
/** @param resource|null $displayName */
public function setDisplayName(null $displayName): void
{
$this->displayName = $displayName;
Expand Down
4 changes: 1 addition & 3 deletions be/src/Entity/Post/Content/PostContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ public function getContent(): ?array
return BlobResourceGetter::protoBufWrapper($this->protoBufBytes, PostContentWrapper::class);
}

/**
* @param resource|null $protoBufBytes
*/
/** @param resource|null $protoBufBytes */
public function setProtoBufBytes(null $protoBufBytes): void
{
$this->protoBufBytes = $protoBufBytes;
Expand Down
4 changes: 1 addition & 3 deletions be/src/Entity/Post/Reply.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ public function getGeolocation(): ?array
return BlobResourceGetter::protoBuf($this->geolocation, Lbs::class);
}

/**
* @param resource|null $geolocation
*/
/** @param resource|null $geolocation */
public function setGeolocation(null $geolocation): void
{
$this->geolocation = $geolocation;
Expand Down
8 changes: 2 additions & 6 deletions be/src/Entity/Post/Thread.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,7 @@ public function getZan(): ?array
return BlobResourceGetter::protoBuf($this->zan, Zan::class);
}

/**
* @param resource|null $zan
*/
/** @param resource|null $zan */
public function setZan(null $zan): void
{
$this->zan = $zan;
Expand All @@ -156,9 +154,7 @@ public function getGeolocation(): ?array
return BlobResourceGetter::protoBuf($this->geolocation, Lbs::class);
}

/**
* @param resource|null $geolocation
*/
/** @param resource|null $geolocation */
public function setGeolocation(null $geolocation): void
{
$this->geolocation = $geolocation;
Expand Down
8 changes: 2 additions & 6 deletions be/src/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ public function getDisplayName(): ?string
return BlobResourceGetter::resource($this->displayName);
}

/**
* @param resource|null $displayName
*/
/** @param resource|null $displayName */
public function setDisplayName(null $displayName): void
{
$this->displayName = $displayName;
Expand Down Expand Up @@ -104,9 +102,7 @@ public function getIcon(): ?array
return BlobResourceGetter::protoBufWrapper($this->icon, UserIconWrapper::class);
}

/**
* @param resource|null $icon
*/
/** @param resource|null $icon */
public function setIcon(null $icon): void
{
$this->icon = $icon;
Expand Down
4 changes: 1 addition & 3 deletions be/src/PostsQuery/BaseQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@ protected function setResult(
$this->stopwatch->stop('setResult');
}

/**
* @return array{result: Collection, hasMorePages: bool}
*/
/** @return array{result: Collection, hasMorePages: bool} */
public static function hasQueryResultMorePages(QueryBuilder $query, int $limit): array
{
$results = collect($query->setMaxResults($limit + 1)->getQuery()->getResult());
Expand Down
4 changes: 1 addition & 3 deletions be/src/Repository/Post/Content/ReplyContentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
use Doctrine\Persistence\ManagerRegistry;
use Symfony\Component\DependencyInjection\Attribute\Exclude;

/**
* @extends PostContentRepository<ReplyContent>
*/
/** @extends PostContentRepository<ReplyContent> */
#[Exclude]
class ReplyContentRepository extends PostContentRepository
{
Expand Down
4 changes: 1 addition & 3 deletions be/src/Repository/Post/Content/SubReplyContentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
use Doctrine\Persistence\ManagerRegistry;
use Symfony\Component\DependencyInjection\Attribute\Exclude;

/**
* @extends PostRepository<SubReplyContent>
*/
/** @extends PostRepository<SubReplyContent> */
#[Exclude]
class SubReplyContentRepository extends PostContentRepository
{
Expand Down
4 changes: 1 addition & 3 deletions be/src/Repository/Post/PostRepositoryFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ public function newSubReplyContent(int $fid): SubReplyContentRepository
return new SubReplyContentRepository($this->registry, $this->entityManager, $fid);
}

/**
* @return array{thread: ThreadRepository, reply: ReplyRepository, subReply: SubReplyRepository}
*/
/** @return array{thread: ThreadRepository, reply: ReplyRepository, subReply: SubReplyRepository} */
public function newForumPosts(int $fid): array
{
return array_combine(
Expand Down
4 changes: 1 addition & 3 deletions be/src/Repository/Post/ReplyRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
use Doctrine\Persistence\ManagerRegistry;
use Symfony\Component\DependencyInjection\Attribute\Exclude;

/**
* @extends PostRepository<Reply>
*/
/** @extends PostRepository<Reply> */
#[Exclude]
class ReplyRepository extends PostRepository
{
Expand Down
4 changes: 1 addition & 3 deletions be/src/Repository/Post/SubReplyRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
use Doctrine\Persistence\ManagerRegistry;
use Symfony\Component\DependencyInjection\Attribute\Exclude;

/**
* @extends PostRepository<SubReply>
*/
/** @extends PostRepository<SubReply> */
#[Exclude]
class SubReplyRepository extends PostRepository
{
Expand Down
4 changes: 1 addition & 3 deletions be/src/Repository/Post/ThreadRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
use Doctrine\Persistence\ManagerRegistry;
use Symfony\Component\DependencyInjection\Attribute\Exclude;

/**
* @extends PostRepository<Thread>
*/
/** @extends PostRepository<Thread> */
#[Exclude]
class ThreadRepository extends PostRepository
{
Expand Down
4 changes: 1 addition & 3 deletions be/src/Repository/RepositoryWithSplitFid.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ abstract class RepositoryWithSplitFid extends BaseRepository
{
abstract protected function getTableNameSuffix(): string;

/**
* @param class-string<T> $postRepositoryClass
*/
/** @param class-string<T> $postRepositoryClass */
public function __construct(
ManagerRegistry $registry,
EntityManagerInterface $entityManager,
Expand Down

0 comments on commit 7425b88

Please sign in to comment.