PHPStan level 3 #1603

Merged
nupplaPhil merged 15 commits from Art4/friendica-addons:phpstan-level-3 into develop 2025-04-27 02:17:42 +02:00
Showing only changes of commit db875bc755 - Show all commits

Remove type casting to int

Art4 2025-03-14 07:49:20 +00:00

View file

@ -961,13 +961,13 @@ function bluesky_complete_post(stdClass $post, int $uid, int $post_reason, int $
if (!empty($existing_uri)) {
$comments = Post::countPosts(['thr-parent' => $existing_uri, 'gravity' => Item::GRAVITY_COMMENT]);
if (($post->replyCount <= $comments) || !$complete) {
return (int) DI::atpProcessor()->fetchUriId($existing_uri, $uid);
return DI::atpProcessor()->fetchUriId($existing_uri, $uid);
Art4 marked this conversation as resolved Outdated

Please change \Friendica\Protocol\ATProtocol\Processor::fetchUriId to always return an integer. This is what the method is expected to do.

Please change `\Friendica\Protocol\ATProtocol\Processor::fetchUriId` to always return an integer. This is what the method is expected to do.
Done with https://github.com/friendica/friendica/pull/14830/commits/8ba652818f169a4391c193f9dde31c3c0dddb61e and removed the type casting with https://git.friendi.ca/friendica/friendica-addons/commit/db875bc755449ec71571a35cb62942b282cae0b9
}
}
if ($complete) {
$uri = DI::atpProcessor()->fetchMissingPost(DI::atpProcessor()->getUri($post), $uid, $post_reason, $causer, 0, '', true, $protocol);
$uri_id = (int) DI::atpProcessor()->fetchUriId($uri, $uid);
$uri_id = DI::atpProcessor()->fetchUriId($uri, $uid);
} else {
$uri_id = DI::atpProcessor()->processPost($post, $uid, $post_reason, $causer, 0, $protocol);
}