markusstaab, (edited ) to random German
@markusstaab@phpc.social avatar

Submitted a fix for #PHPStan which makes sure the result cache can be shared between the baseline generating and the regular analyse command.

meaning when creating a baseline after you ran the analysis, the command finishes instantly (and vice versa). no more full project scan.

https://github.com/phpstan/phpstan-src/pull/2606

markusstaab, to random German
@markusstaab@phpc.social avatar

Just pushed a new release of #PHPStan #baseline analysis.

it adds support for Tomas Votruba's
type-coverage 0.2.x output format (in addition to 0.1.x) and adds support for couting of deprecated functions and properties

https://github.com/staabm/phpstan-baseline-analysis

image/png

markusstaab, to random German
@markusstaab@phpc.social avatar

#PHPStan 1.10.33 ships again with a few performance improvements 🔥

mikestreety, to programming
@mikestreety@hachyderm.io avatar

We've had an internal linter for years, which is built on a PHP #symphony framework.

You run the linter you want and append --fix if you want it to resolve issues (if it can)

It lints things like #JS, #SCSS as well as #PHP (via #Rector and #phpstan), #Composer files and even #TYPO3 TypoScript files - all by using the open source libraries available.

It means all our developers can adhere to central linting conventions without having to update local config files.

markusstaab, to random German
@markusstaab@phpc.social avatar

Analyze your native type coverage and baselines over time. Generate to make sure managment knows what you achieved or define future goals.

https://github.com/staabm/phpstan-baseline-analysis

outofcontrol, to php
@outofcontrol@phpc.social avatar

New plugin for to give you type coverage right in Pest. Simply composer require pestphp/pest-plugin-type-coverage —dev and then run Pest with pest —type-coverage -min=100 Perhaps you won’t need or anymore.

Four other great new features in Pest in Like Downing’s video on Laracasts here https://laracasts.com/series/lukes-larabits/episodes/7

markusstaab, to random German
@markusstaab@phpc.social avatar

Just today I have released the 125th #rexstan release - the #PHPStan integration for @REDAXO CMS

markusstaab, to random German
@markusstaab@phpc.social avatar

Taught #PHPStan #unused to report public class-constants and public properties which are only used in tests.

getting rid of dead code helps you concentrate your efforts on things really used.

https://github.com/TomasVotruba/unused-public

markusstaab, to random German
@markusstaab@phpc.social avatar

Today I have added #PHPStan native type coverage into the trend report analysis of https://github.com/staabm/phpstan-baseline-analysis

we do the rendering based on markdown which we render with the json based analysis format a colleague implemented recently

with this our weekly reports got more useful and now look like:

lhengstmengel, to php
@lhengstmengel@mastodon.nl avatar

Trying to fix all #phpstan errors for level 7 and up is quite an "interesting" experience. Fix one error, and four new errors appear...! 😅#php

iCaspar, to Laravel
@iCaspar@phpc.social avatar

I've read (somewhere on the internet) that it's possible to run #phpstan at level 9 with #laravel. But after messing around with it most of an evening, getting a clean run has eluded me. Can get a clean run up to level 7.

Most of the issues come from Auth and Profile related controllers that I'm pretty sure were generated by Breeze and have to do with not being able to get a read on User models when they're the result of calling $request->user().

(using the nunomaduro /
larastan package)

PHPCSFixer, to random
@PHPCSFixer@phpc.social avatar

📢 New release!

Fixer v3.21.2 is a technical release with maaaaany DX improvements 🙂. Kuba Werłos took #PHPStan's strict rules on the table and improved many parts of the code. There are also other enhancements, just look at the release notes:

https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases/tag/v3.21.2

ultimike, (edited ) to drupal
@ultimike@drupal.community avatar

How about a new episode of the @drupaleasy podcast with @mglaman talking about #phpstan and his #drupal Retrofit project?

https://www.drupaleasy.com/podcast/2023/07/drupaleasy-podcast-s15e3-matt-glaman-phpstan

neclimdul,

@ultimike @drupaleasy @mglaman

Did you mean #phpstan ?

velkuns, to php French
@velkuns@phpc.social avatar

Today, I am up from 8 to 9 (max) the phpstan level of an internal client SDK for internal API in my job.

Need some internal refactoring was required, with some generic phpstan doc comment.

But finally made it, with only one test to change. And add one test for 100% coverage.

Thanks to me in past to do the full coverage and ensure this kind of refactoring works well.

Conclusion: add tests for you in future. That will make refactoring and rewriting to be safe 👍

markusstaab, to random German
@markusstaab@phpc.social avatar

#phpstandba crossed the 200 stars 🌟

it may also be helpful for you, in case you don‘t use fully fledged orm. It covers your database access layer with #phpstan type inference based on the database schema

https://github.com/staabm/phpstan-dba


the idea behind phpstandba in a few slides

https://staabm.github.io/talks/phpstan-dba@phpugffm/

markusstaab, to random German
@markusstaab@phpc.social avatar

Enjoy improved call_user_func() support in the latest #phpstan release - in addition to some really cool other stuff

image/png

markusstaab, to random German
@markusstaab@phpc.social avatar

If all goes according to plan, a future #phpstan release will be able to resolve the return type and validate the parameter-types of a callable used in call_user_func().

✅Another source of mixed-types

https://github.com/phpstan/phpstan-src/pull/2479

https://phpstan.org/r/94359d89-5215-4152-b61c-1d3108cf706a

michabbb, to php German
@michabbb@vivaldi.net avatar

the moment, when you finally see: [OK] No errors 😊 (after fixing >300 errors)

#php #phpstan

video/mp4

syntaxseed, to php
@syntaxseed@phpc.social avatar

Developer folks....

If you want to describe that a project has been fixed for all the errors found by a static analysis tool up to a certain level, how would you say it?

Ex:
"This project is ______ for #PHPStan level 6."

  • fixed
  • valid
  • passing
  • correct
  • ?

#PHP #TechDocs

phpugmrn, to random German
@phpugmrn@phpc.social avatar
markusstaab, to random German
@markusstaab@phpc.social avatar

To make sure you will no be bitten like me by code passing message_type=2 to error_log() - which fatal errors on PHP8+ ... I made a small #PHPStan fix so it gets reported.

Only works on bleedingEdge for now though.

https://github.com/phpstan/phpstan-src/pull/2428

phpugmrn, to random German
@phpugmrn@phpc.social avatar

#ToolTip #PHPStan rules to measure the cognitive complexity of your classes and methods https://github.com/TomasVotruba/cognitive-complexity

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • ngwrru68w68
  • magazineikmin
  • InstantRegret
  • tacticalgear
  • ethstaker
  • rosin
  • Youngstown
  • slotface
  • khanakhh
  • kavyap
  • mdbf
  • GTA5RPClips
  • DreamBathrooms
  • provamag3
  • everett
  • thenastyranch
  • normalnudes
  • cisconetworking
  • love
  • modclub
  • cubers
  • Durango
  • osvaldo12
  • Leos
  • tester
  • anitta
  • JUstTest
  • All magazines