Schrank, to random
@Schrank@phpc.social avatar

Can I tell #phpstan which type a call has?

$country->getIso() is string|null, but I'm sure it is string - or at least I'm fine ignoring the unexpected case 🙈
Or do I neet to put it in a var to add a /**@var to it?

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

My #phpstan extension #todoby recently crossed 150 stars.

it allows you to put expiration on your code comments.
a comment can expire by e.g. a github, jira or youtrack issue-url. expiration dates and composer version constraints also work.

give it a shot :)

https://github.com/staabm/phpstan-todo-by

DoubleA, to php

Dumb question here, I'm looking at tools to find compatibility issues with a project moving from PHP 5.6 -> 8.2.

Does anybody have experience with PHPStan and can explain how I could use that for this task? Is it just a matter of specifying a certain level to run it at? I'm running it but I think it's showing existing problems unrelated to PHP 8.2 compatibility and I'd like to just focus in on problems related to PHP 8.2 compatibility

#PHP #PHPStan #LegacyCode

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

stefanzweifel, to php
@stefanzweifel@phpc.social avatar

While making my PHP packages compatible with Laravel 11 the last few weeks, I've also spent some time and added PHPStan to all of them.

The more simpler ones are already on level 9. The more complex are still on level 5 or 6. I'm still a novice when it comes to proper type documentation. Goal is to increase levels throughout the year.

Links to all packages:
https://stefanzweifel.dev/projects

#php #phpstan

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

As of 0.1.16 learnt to expire comments based on issue ticket references. This means when a ticket is 'resolved' leftover todos will error.

ATM only JIRA is supported - thanks to @EMasiakowski

details in the projects readme:
https://github.com/staabm/phpstan-todo-by

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

Just pushed a new #phpstan #todoby release which adds support for expiring code comments by @github issue tracker idenfitiers.

PHPStan will emit errors when github issues or pull requests get closed, to get you informed. thx @emasiakowski

see readme
https://github.com/staabm/phpstan-todo-by#github

this means we now support JIRA and github issues. support for #youtrack is in the making.

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

ctietze, to php
@ctietze@mastodon.social avatar

In #PHP, a language without a compiler, static checking via #PHPStan is really neat. I'm running this on the command line ever now and then to see whether I messed something up during a rename or refactoring. That's not as convenient as a type checker in an IDE like Xcode which is constantly running in the background, but it's bridging a lot of the gaps.

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

mglaman, to drupal
@mglaman@phpc.social avatar
t3muc, to php German
@t3muc@typo3.social avatar

Am Dienstag, 12. Februar, geht es um 19 Uhr um das Thema Projektübernahmen und -updates.
@danielsiepmann zeigt uns, wie eine Übernahme gelingt und wie man das Projekt anschließend aktualisiert. Dabei gehts dann auch um Themen wie , Linting, Testing mit @phpunit und Tools wie @phpstan oder .

➡️ https://www.meetup.com/de-DE/munich-typo3-user-group/events/298927902/

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

In my daily projects I stumbled over code which contained references to global magic constants like CLASS outside of classes.

to catch these errors I have implemented a new rule which can be enabled in the latest #phpstan release with bleeding edge.

https://phpstan.org/r/1dac70cb-0a93-46a6-bbcd-58e571166f69

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

Turns out I am one of the top contributors💫 to , and related tools.

If one of those open source projects is critical for your business, please consider supporting my work with your sponsoring 💕

https://github.com/sponsors/staabm

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

This looks like some great type inference stuff will be possible in the future

#phpstan

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, (edited ) to random German
@markusstaab@phpc.social avatar

Just released a new extension release with experimental support for @symfony trigger_deprecation().

please give it a try and provide feedback

https://github.com/staabm/phpstan-todo-by/releases/tag/0.1.24

See discussion: https://github.com/staabm/phpstan-todo-by/issues/47

OndrejMirtes, to random
@OndrejMirtes@phpc.social avatar

London here I come! ✈️🐘 @phpukconference

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

Anyone having the problem of accidental wrong "use" statements like

use _PHPStan_156ee64ba\Symfony\Component\String\Exception\RuntimeException;

taken from prefixed-phar files, e.g. because of bad IDE autocompletion?

Fixed it for you in #phpstan

https://phpstan.org/r/bdd5949f-b3d6-4b57-b2de-813e431b6563

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.

OndrejMirtes, to random
@OndrejMirtes@phpc.social avatar

Sometimes I like to write silly commit messages. #phpstan

si, to drupal

Belated deep dive on #phpstan, my overview of getting started with a #drupal site https://youtu.be/8al0GVuYwYY

PHPCSFixer, to random
@PHPCSFixer@phpc.social avatar

📢 NEW RELEASE!

Fixer v3.55 brings brand new ordered_attributes rule that extends our support for #PHP8 😁. There are also multiple internal improvements, as we bumped #PHPStan level to 7 and fixed several reported issues.

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

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

I am working on improving typing in nikic/PHP-Parser so static analysis tooling can assist you better when working directly with the AST.

Also fixing CI while at it.

I started this because we ran into a edge-case fatal error in #PHPStan.

https://github.com/nikic/PHP-Parser/pull/993

OndrejMirtes, to random
@OndrejMirtes@phpc.social avatar

When I find an easy fix for a bug I thought was unfixable for 3 years… #phpstan

Vibing White Cat GIF

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