Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122232 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 482 invoked from network); 23 Jan 2024 13:02:24 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 23 Jan 2024 13:02:24 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1706014988; bh=KNvN3rTjnavQMTuQX18c3mph3DRQocKh6NOpBQK8mDQ=; h=Date:To:From:Cc:Subject:In-Reply-To:References:From; b=Z7BAfuNoqHH/kUwwXUz+AF8xaV8IS0xXwlVqf8dWGBJzu1dA2CDg6JlgHCwwqveQw djMx3NMZMI5sYybec69wLzpjT5JLA+oPXWAcfahqcu2MV1krXwRugy77+zRYUZ14GP /ApDiLiumqZ2bi67SlCxPKo2pIrU/jDgJlJbfKsyDhxbpblCb7JZp9WWCux/Y8sKgL e65Tmrsjqc8eDGXWDzCJsUkO9xwuokogxUVcFJbIv5kDGcXoZyM6Ov/2DhDHsA6XLR lNwsiGTHIuxnYFjmGkJgBfxmqrzgeBvMMgCTEZGfGPXAroC0ZK196elt9oGO9X8D8Q S/0gaUM4F+tVA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5AD3F18005B for ; Tue, 23 Jan 2024 05:03:06 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-4022.proton.ch (mail-4022.proton.ch [185.70.40.22]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 23 Jan 2024 05:03:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gpb.moe; s=protonmail; t=1706014939; x=1706274139; bh=KNvN3rTjnavQMTuQX18c3mph3DRQocKh6NOpBQK8mDQ=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=o2Y5YFDE/pvs3Aqe5ou9kVtSRXlCLwFizn/tnjClEWaMF1V/L5HpTEE2mXQ1lEmwA fKkiedRZvIVXZGgXBDDF38doHhzpyN/6iTOmqHkgoHNSbpJfksIRvvIdw57VO9sgdu NvOM9id1Cy417Zm7yruYDaqGF4+kq1byzrMrJO5Vrm79bncrNiewij8FqVV7npQWAq 4jYuXM/PeHEXuR3XQLV+D26j63j5+uaCUazlYgcZ3I5qfA65kTqyOlX808KPsXbhSE 2ruklrQ2/yyzEtgVlScbcvYsvnifmVGfuTPd19p+Qzdp5v3Ylhjv/lFlQxof4N4aOI FaSP/e78D55hA== Date: Tue, 23 Jan 2024 13:02:03 +0000 To: Juliette Reinders Folmer Cc: internals@lists.php.net Message-ID: In-Reply-To: <65AF2859.8000504@adviesenzo.nl> References: <344c3e06-3822-4b20-9a6f-a58fb64929a7@app.fastmail.com> <65AF2859.8000504@adviesenzo.nl> Feedback-ID: 96993444:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Deprecate implicitly nullable parameter type From: internals@gpb.moe ("Gina P. Banyard") On Tuesday, 23 January 2024 at 02:45, Juliette Reinders Folmer wrote: > On 23-1-2024 3:18, Gina P. Banyard wrote: > > > The RFC notes that PHPStan and friends have an easy flag to make the = change, which is great, but still that's a minority of PHP devs that even k= now to use static analysis. > > > One does not need to use a static analyser to determine or fix this i= ssue, indeed, I didn't even mention static analysers in the RFC as PHP_CS_F= IXER is a tool for enforcing coding styles and is capable of fixing this is= sue. > > > This tool and other code formatting tools are used more widely and fo= r longer than static analysers. >=20 > While I concur that too few devs use the helpful tooling available to > them, I can already tell you that PHPCompatibility for PHP_CodeSniffer > will be able to detect and flag code subject to this deprecation without > problems and I will make sure the sniff is available ahead of the PHP > 8.4 release (providing the RFC passes). >=20 > And the Slevomat Coding Standard for PHP_CodeSniffer already contains > the `SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue` > sniff to auto-fix non-nullable typed parameters with a `null` default > value to be nullable typed as well, so it's not just CS-Fixer which can > help with this. I had a hunch that PHP_CodeSniffer was able to handle this already, I just = couldn't find the correct sniff. :) I'll mention it if/when I update the RFC text. Best regards, Gina P. Banyard