jlai.lu
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
monica_b1998@lemmy.world to PHP@lemmy.ml · 3 months ago

Introducing Safe and Progressive Strict Type Adoption Rule

getrector.com

external-link
message-square
0
link
fedilink
  • cross-posted to:
  • php@programming.dev
4
external-link

Introducing Safe and Progressive Strict Type Adoption Rule

getrector.com

monica_b1998@lemmy.world to PHP@lemmy.ml · 3 months ago
message-square
0
link
fedilink
  • cross-posted to:
  • php@programming.dev
PHP's `declare(strict_types=1)` directive is a powerful tool for preventing subtle bugs. Yet most existing, mature projects don't use it consistently, if at all. Why? Because automatically adding it to all your files at once will cause your application to explode: expect thousands of errors. That leaves you fixing files by hand, one by one, and relying on team members to remember to add it to new files. Without a safe and automated process, adoption hardly ever sticks. Until now. The new `SafeDeclareStrictTypesRector` only adds strict types to files that are **already type-safe**, making safe, progressive adoption finally possible and preventing the file from becoming non-strict in the future.
alert-triangle
You must log in or # to comment.

PHP@lemmy.ml

php@lemmy.ml

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !php@lemmy.ml
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 1 user / day
  • 1 user / week
  • 1 user / month
  • 4 users / 6 months
  • 1 local subscriber
  • 217 subscribers
  • 18 Posts
  • 0 Comments
  • Modlog
  • mods:
  • Ernest@lemmy.ml
  • BE: 0.19.18
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org