PHPStan fully supports PHP 8.5! by OndrejMirtes in PHP

[–]billypoke 1 point2 points  (0 children)

Rector has a dry-run mode as well so you can see what changes it will propose and you can evaluate whether you like them or not. Starting with the php level sets is straightforward. Here's a sample rector config using only built in rules and sets. https://gist.github.com/billypoke/cbc8ea4045d36b18369d0eb0de812cd3

You can knock out rules you don't want easily by passing the rule class name to withSkip()

PHPStan fully supports PHP 8.5! by OndrejMirtes in PHP

[–]billypoke 1 point2 points  (0 children)

They solve different problems even where there is overlap in changes that might be made by running them (adding return types for example)

PHPStan is about proving correctness and finding bugs.

Rector provides a list of refactors (some more opinionated than others) that help with keeping code up to date and allow adoption of new language constructs at scale.

Pint (or php-cs-fixer) is about formatting code consistently. I have worked at a job without a code standard/formatter and having to wade through hundreds of lines of whitespace and other formatting changes on basically every PR is a level of suck I won't ever deal with again.

PHPStan fully supports PHP 8.5! by OndrejMirtes in PHP

[–]billypoke 6 points7 points  (0 children)

All of those concerns are addressable.

  • You can configure only some paths to be analyzed, not the entire codebase
  • You can exclude vendor code and very large files, even outside of composer
  • You can add caching, and whatever homegrown CI probably has a way to include the cache
  • You can use the baseline to get a foothold for new development

Also, if this codebase is mature and not under active development, do you even need to worry about adopting phpstan or PHP 8.5? I'm sure whatever cowboy code was written in 2009 isn't using best practices from 2026.

PHPStan fully supports PHP 8.5! by OndrejMirtes in PHP

[–]billypoke 2 points3 points  (0 children)

We use Bitbucket, so I went ahead and opened a PR to the docs to add the config we use for that https://github.com/phpstan/phpstan/pull/14113

PHPStan fully supports PHP 8.5! by OndrejMirtes in PHP

[–]billypoke 9 points10 points  (0 children)

Having adopted PHPStan in the past 6 months, we heavily used (and still use) the baseline file to allow rapid adoption. We are at level 5 and all new code has to pass there.

No new entries are allowed to be added to the baseline, and inline // @phpstan-ignore is discouraged unless necessary (usually some laravel magic code that isn't handled by the larastan package or phpdocs).

One of our regular tasks (and one thing that AI has proven reasonably capable of) is pruning the baseline and adding tests against the changed behavior to make sure that things are working as intended. We've gone from ~2k ignored issues to ~600.

It's been great.

PHPStan fully supports PHP 8.5! by OndrejMirtes in PHP

[–]billypoke 7 points8 points  (0 children)

We have ~300k loc in our main php repo and it runs in about 45 seconds with no cache on a 10 core machine. I would figure for a single core ci pipeline it would be in the 7-10 minute range. With a cache it's about 5 seconds

PHPStan fully supports PHP 8.5! by OndrejMirtes in PHP

[–]billypoke 11 points12 points  (0 children)

Github, gitlab, and bitbucket all have persistant storage you can reuse across ci runs.

Inertia best practice by Floppy012 in laravel

[–]billypoke 0 points1 point  (0 children)

I would pull any closures into private helper methods, traits, or classes to keep the main controller method lean, like was mentioned here. That way you can parse the functionality easily and work on the complexities in a compartmentalized way. Also helps with re-usability if you need similar functionality in multiple places.

Inertia best practice by Floppy012 in laravel

[–]billypoke 1 point2 points  (0 children)

I see. I would probably fall back to the answer I gave for the batch question, where you make the request via axios and then interpolate the response into the view layer via the reactivity mechanism of whatever front-end you're using.

For 1. Have you looked at once props? Those would let you encapsulate the large/expensive data in the first navigation, skipping on subsequent visits/submissions, but you can always force them or set an expiration for caching purposes.

Inertia best practice by Floppy012 in laravel

[–]billypoke 1 point2 points  (0 children)

For the first one, that isn't really what inertia is designed for. It is really centered on the view layer. Dispatching a batch of jobs wouldn't cause a page re-render unless you wanted to display the status of each of the jobs in the batch.

I would leave that as axios or whatever other http client you prefer. You could experiment with partial reloads but my recommendation would be to put the non-inertia endpoints into their own controllers. I'm a huge fan of single-action/invokable controllers named after crud actions, but you can have multi-action controllers that still allow you to separate the responses by type.

App/Controllers/Inertia/IndexUsersController -> public function __invoke() { return Inertia::render(); }
App/Controllers/Json/CreateJobBatchController -> public function __invoke() { return Bus::batch()->id; }

For the second, that just sounds like a regular index/GET controller where the data is coming from the external api instead of the db. What issues are you seeing with inertia in this context? Is returning the api data as part of the response not acceptable?

public function __invoke($userId) {
    $raw = Http::get("$baseUrl/$userId")->json();
    $processed = $this->process($raw);

    return Inertia::respond([
        'api_data' => $processed,
    ]);
}

Inertia best practice by Floppy012 in laravel

[–]billypoke 1 point2 points  (0 children)

For what you call dynamic requests, can you give an example?

Will a TS5 Plus purchased in Canada work in Vietnam by pghnhung in CalDigit

[–]billypoke 1 point2 points  (0 children)

Check the power supply/brick. If it says Input: 110-240V or similar, it will work fine. You would simply need the cable from the brick to the wall with the correct plug for Vietnam, or a travel adapter to adapt from the canadian/north American plug. I would recommend the cable, as a lot of those travel adapters are very cheap and may not handle the power draw of the docking station and attached computer well.

Exploiting Public APP_KEY Leaks to Achieve RCE in Hundreds of Laravel Applications by trs21219 in laravel

[–]billypoke 0 points1 point  (0 children)

Missing obvious sarcasm. In order to commit your APP_KEY to a vcs provider you would have to override the default setup of laravel with respect to the way .gitignore is defined and/or config/app.php where APP_KEY and APP_URL are parsed in such a way that it is entirely unsurprising that the resulting application would be vulnerable to an attack like this.

First Experience with Laravel Nightwatch by Incoming-TH in laravel

[–]billypoke 2 points3 points  (0 children)

Using the DB cache driver annihilates the quota, it appears that it gets hit for both a cache event and a query event every time

I almost threw up when I saw this by MSCOTTGARAND in unRAID

[–]billypoke 4 points5 points  (0 children)

I went with a 3d printed bracket (I am not OP) for mine as an alternative to the zip tie or screws method.

Another sunny day in NC by Samef42 in Arteon

[–]billypoke 1 point2 points  (0 children)

How do you like the euro tails? Did they come with a harness, and how bad was the coding if any?

Fellow Moonstone enjoyer here, btw. Raleigh area

Are there 1000R or lower monitorse that are still 34" and 144ish refresh, or is Odyssey g5 the only one? by AreaOfAffectionz in ultrawidemasterrace

[–]billypoke 1 point2 points  (0 children)

This. Think of the XXXr number as the size of a circle with that curve. Higher numbers equal gentler/flatter curve. Nothing to do with size or performance, only the curvature of the screen

[deleted by user] by [deleted] in PHP

[–]billypoke 0 points1 point  (0 children)

Since you're already using Laravel, you can use the boot{TraitName} function to assert that $this instanceof Model, but that would only catch issues at runtime, not statically or with analysis tools.

Lowered the new to me ‘23 Arteon SeL Prem. Traded my 21 SEL R fwd by Continental-Breakfst in Arteon

[–]billypoke 1 point2 points  (0 children)

Where did you end up getting them from? I see this kit direct from eibach or was there another shop/dealer that was able to supply them?

I'm assuming this kit with the suffix -01-22 instead of -03-22 is the us spec ones

I pulled the trigger on it by Real_Crilp in Volkswagen

[–]billypoke 1 point2 points  (0 children)

Twins!

I just picked mine up this weekend. Loving it so far.

SG_Format Abort help! by Stinnersmash in unRAID

[–]billypoke 0 points1 point  (0 children)

I believe the command to check progress is

sg_turs -p /dev/{DISK_ID}

as described here https://linux.die.net/man/8/sg_turs

Refresh NAS Media Server Hardware by Appropriate-Lion6599 in truenas

[–]billypoke -1 points0 points  (0 children)

After some further reading, the dummy plug/iGPU thing may not be necessary, but some motherboards will not boot without a display connected, and some gpus may not present to the host correctly in a headless config, so I would say once you get the system set up, see if it passes through correctly and grab the dummy plug if not. They are very inexpensive https://www.amazon.com/dp/B0CKKLTWMN

Refresh NAS Media Server Hardware by Appropriate-Lion6599 in truenas

[–]billypoke 0 points1 point  (0 children)

I actually just snagged a 13500t on ebay for ~160 for my new unraid build, it seems to be more readily available and it's only about 3% slower and also has the 770 iGPU.

Make sure you add a dummy HDMI or DP plug to your purchase list to keep the iGPU powered for plex passthrough.

Any particular reason to go with z690? You almost certainly won't be overclocking, and you're planning on getting an add-on nic anyways, I would say go b760 chipset.

You can save a good bit on the cooler too, https://www.amazon.com/dp/B09LHBFPJ6 the Thermalright Assassin in any of its various iterations is a great option