Larastan 1 to 2

pull/7362/head
Your Name 5 days ago
parent 2be73c4879
commit 33a6c642ea

@ -123,7 +123,7 @@ class ImportCities extends Command
$count++;
if ($count % $this->argument('chunk') === 0) {
if ($count % (int) $this->argument('chunk') === 0) {
$this->insertBuffer($buffer);
$bar->advance(count($buffer));
$buffer = [];

@ -238,9 +238,6 @@ class ApiV1Controller extends Controller
/**
* GET /api/v1/accounts/lookup
*
* @param string $acct
* @return \App\Transformer\Api\AccountTransformer
*/
public function accountLookupById(Request $request)
{
@ -1191,8 +1188,6 @@ class ApiV1Controller extends Controller
/**
* GET /api/v1/accounts/relationships
*
* @param array|int $id
* @return RelationshipService
*/
public function accountRelationshipsById(Request $request)
{
@ -1478,8 +1473,6 @@ class ApiV1Controller extends Controller
* GET /api/v1/custom_emojis
*
* Return custom emoji
*
* @return array
*/
public function customEmojis(): Response
{
@ -1490,8 +1483,6 @@ class ApiV1Controller extends Controller
* GET /api/v1/domain_blocks
*
* Return empty array
*
* @return array
*/
public function accountDomainBlocks(Request $request): JsonResponse
{
@ -1505,8 +1496,6 @@ class ApiV1Controller extends Controller
* GET /api/v1/endorsements
*
* Return empty array
*
* @return array
*/
public function accountEndorsements(Request $request): JsonResponse
{
@ -1759,8 +1748,6 @@ class ApiV1Controller extends Controller
* GET /api/v1/filters
*
* Return empty response since we filter server side
*
* @return array
*/
public function accountFilters(Request $request): JsonResponse
{
@ -1907,8 +1894,6 @@ class ApiV1Controller extends Controller
* GET /api/v1/suggestions
*
* Return empty array as we don't support suggestions
*
* @return null
*/
public function accountSuggestions(Request $request): JsonResponse
{
@ -2012,8 +1997,6 @@ class ApiV1Controller extends Controller
* GET /api/v1/lists
*
* Return empty array as we don't support lists
*
* @return null
*/
public function accountLists(Request $request): JsonResponse
{
@ -2027,7 +2010,6 @@ class ApiV1Controller extends Controller
* GET /api/v1/accounts/{id}/lists
*
* @param int $id
* @return null
*/
public function accountListsById(Request $request, $id): JsonResponse
{
@ -3608,7 +3590,6 @@ class ApiV1Controller extends Controller
* GET /api/v1/statuses/{id}/card
*
* @param int $id
* @return StatusTransformer
*/
public function statusCard(Request $request, $id): JsonResponse
{

@ -1278,9 +1278,6 @@ class ApiV1Dot1Controller extends Controller
/**
* POST /api/v1.1/status/create
*
*
* @return StatusTransformer
*/
public function statusCreate(Request $request)
{

@ -41,9 +41,6 @@ class TagsController extends Controller
/**
* POST /api/v1/tags/:id/follow
*
*
* @return object
*/
public function followHashtag(Request $request, $id): JsonResponse
{
@ -169,9 +166,6 @@ class TagsController extends Controller
/**
* GET /api/v1/followed_tags
*
*
* @return array
*/
public function getFollowedTags(Request $request): JsonResponse
{

@ -133,8 +133,6 @@ class RegisterController extends Controller
/**
* Show the application registration form.
*
* @return Response
*/
public function showRegistrationForm(): RedirectResponse|View
{

@ -87,8 +87,6 @@ class ResetPasswordController extends Controller
* Display the password reset view for the given token.
*
* If no token is present, display the link request form.
*
* @return Factory|View
*/
public function showResetForm(Request $request): View
{
@ -150,7 +148,6 @@ class ResetPasswordController extends Controller
* Get the response for a failed password reset.
*
* @param string $response
* @return RedirectResponse|JsonResponse
*/
protected function sendResetFailedResponse(Request $request, $response): RedirectResponse
{

@ -16,7 +16,6 @@ use Illuminate\Support\Carbon;
* @property bool $is_admin
* @property string $email
* @property Carbon|null $email_verified_at
* @property bool $2fa_enabled
* @property string|null $register_source
* @property string|null $app_register_ip
* @property bool $has_interstitial

@ -142,7 +142,7 @@ class Autolink extends Regex
protected $extractor = null;
/**
* @var autolinkActiveUsersOnly
* @var bool
*/
protected $autolinkActiveUsersOnly = false;
@ -466,8 +466,8 @@ class Autolink extends Regex
/**
* Auto-link hashtags, URLs, usernames and lists, with JSON entities.
*
* @param string The tweet to be converted
* @param mixed The entities info
* @param string $tweet The tweet to be converted
* @param mixed $json The entities info
* @return string that auto-link HTML added
*
* @since 1.1.0
@ -517,7 +517,7 @@ class Autolink extends Regex
/**
* Auto-link hashtags, URLs, usernames and lists.
*
* @param string The tweet to be converted
* @param string $tweet The tweet to be converted
* @return string that auto-link HTML added
*
* @since 1.1.0

@ -99,8 +99,6 @@ class HitHighlighter extends Regex
* @param string $tweet The tweet to be hit highlighted.
* @param array $hits An array containing the start and end index pairs
* for the highlighting.
* @param bool $escape Whether to escape the tweet (default: true).
* @param bool $full_encode Whether to encode all special characters.
* @return string The hit highlighted tweet.
*/
public function highlight($tweet = null, ?array $hits = null)

@ -34,7 +34,7 @@ class LooseAutolink extends Autolink
/**
* Auto-link hashtags, URLs, usernames and lists.
*
* @param string The tweet to be converted
* @param string $tweet The tweet to be converted
* @return string that auto-link HTML added
*
* @deprecated since version 1.9.0

File diff suppressed because it is too large Load Diff

@ -1,14 +1,14 @@
includes:
- vendor/larastan/larastan/extension.neon
- vendor/nesbot/carbon/extension.neon
- phpstan-baseline.neon
parameters:
level: 0 #Larascan supports 0-9. 10 is not required
level: 2 #Larascan supports 0-9. 10 is not required
paths:
- app/
- routes/
- tests/
excludePaths:
- bootstrap/cache/*
@ -40,4 +40,44 @@ parameters:
ignoreErrors:
- '#Unsafe usage of new static#'
# Larastan's Redis facade stubs are incomplete: pipeline() accepts a
# callback and set() accepts TTL/flag args. These calls are valid.
-
message: '#Static method Redis::pipeline\(\) invoked with 1 parameter, 0 required#'
paths:
- app/Services/NotificationService.php
- app/Services/StoryIndexService.php
-
message: '#Static method Redis::set\(\) invoked with 4 parameters, 2-3 required#'
path: app/Services/NotificationService.php
# Eloquent dynamic "where{Attribute}()" magic methods that Larastan
# cannot resolve for these models. Calls are valid at runtime.
-
message: '#Call to an undefined static method App\\Models\\GroupPost::where\w+\(\)#'
paths:
- app/Http/Controllers/Groups/GroupsPostController.php
- app/Jobs/GroupPipeline/GroupCommentPipeline.php
# Fractal resource property set dynamically from the transformed data.
-
message: '#Access to an undefined property App\\Http\\Resources\\AdminUser::\$2fa_enabled#'
path: app/Http/Resources/AdminUser.php
# Intentional defensive empty()/isset() guards on values that the
# current control flow proves are always set. Kept for safety against
# future refactors; not bugs.
-
message: '#in empty\(\) always exists and is (not falsy|always falsy)#'
paths:
- app/Http/Controllers/FederationController.php
- app/Jobs/InboxPipeline/InboxValidator.php
- app/Models/CustomFilter.php
- app/Util/ActivityPub/Helpers.php
-
message: '#in isset\(\) always exists and is not nullable#'
paths:
- app/Http/Controllers/StoryComposeController.php
- app/Util/Lexer/Validator.php
reportUnmatchedIgnoredErrors: false

Loading…
Cancel
Save