Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123218 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 55EE91A009C for ; Fri, 26 Apr 2024 13:38:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1714138774; bh=TEoaFUIjqWxhjBhprqGCObtfkILpTV62GLrqXbAtwWI=; h=References:In-Reply-To:Reply-To:From:Date:Subject:To:Cc:From; b=eTWGdDZoaoL0QxsHErXljV26CGiQS/PyZls+oeLVy9582WCyKQ02wY2yxWk8nSTzd 9/9SXcy2MxevO/H+4ZjcQFzXNeZLKVVyW3GJx9ZrCDd7/4QLivB0Lh3LzGmiL5lm2G ok6te6gOvR9qPQRTStodXWxfTQuX67VTI6WvgjDjD1h56+xHNHd463oGMDMk+HqC4t lAsN6TZ1J81FcMOuyJ+ZIV3WV3r3zc1VvGkZr1GWq2jsabZC8/q603FFcr98iiDy7U Gf0IipYPmSWSU1q/7Bdx5VqsxAERM0L9HkWWWbn7Gvy22fMG/rlr6sy0YGPDjuv1Jj kaaKys0ADlGRQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CF39418068D for ; Fri, 26 Apr 2024 13:39:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,FREEMAIL_REPLYTO_END_DIGIT, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-yb1-f170.google.com (mail-yb1-f170.google.com [209.85.219.170]) (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 ; Fri, 26 Apr 2024 13:39:32 +0000 (UTC) Received: by mail-yb1-f170.google.com with SMTP id 3f1490d57ef6-dbed179f0faso2505615276.1 for ; Fri, 26 Apr 2024 06:38:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714138730; x=1714743530; darn=lists.php.net; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=G85nVD96xByAsC+Q9kHSX9kSzYeDP+4bxAxzwtdkKXs=; b=WuT4Gb8N67+gv0yu9I9/1gMDSedqrf319Tq1lMpg0xEeLpuXVL+tcLz/3WFXYfswYs NxzNeUIe43SHPi0luwJV1WlnbMFLgxg9AVsLyf8niSpNhnzSHWaABTOWJtfjiT+TDhHy lAXAcwc9/cWblQlaG9JPtknpsEvoFGlGlYN78BGnraSTqwiSHo2Nm8NeWsbkJ6S6wEY+ Kouq7XFqbyzERbhklNyJzE1kX1QHgm2fmi32mIXG7gZgA2nNeqp9YaPfCY0c3EQSAtDc ew/xe92cxSVOMyOK9uMCnFzoG8HwzYAAB2wH4JJBH2h7BVXyyaJqCk/wYwYFEhVnLokX 7E6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714138730; x=1714743530; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=G85nVD96xByAsC+Q9kHSX9kSzYeDP+4bxAxzwtdkKXs=; b=GIbfm5zMbso4WrLyJ48GVT1JbSBgXuXrghewJ7ngGHKSSS0tB0Pp02DpticDSPqBmh xrwSpRhQrB/Eo2g06RHzuUCONrLaL/l8tHdmjCJRTpw9HzAtJlsaFSU2GA8Z09ctn3fe ggHh7fMokHs+5BRgTu3u9Om0nEK9sGLVerZ0dkWuhof1rMPT0u8rlh+keHmvRYGkYWu2 3oBIQNOLusXZA5x78GTQAyvk1KG5uFTN2+CMFsl+yIU/557No8YkH4egZEdCmX/00bpa fKvZL78gJ517boaqq7fjqXHRBXuzQpGvuWyOVu9i9Esuv4R5xVOCL3vXt0YN/ToHrpOd g4pQ== X-Forwarded-Encrypted: i=1; AJvYcCUST/7XeceeY8tkimQ4aSVUIu8nE1226UFdUKtbMqbyNXDBWhCc7pbpbqMZpZJjjrrUe41MgNNvkXRAFGQ5opkIkARrNRoStQ== X-Gm-Message-State: AOJu0YwB69ag6CuFtS4Xaki25TFqhA/z0FEJ9Nku6L+qiGDhTrrwKeT3 uJG/EboZo37wZyLVFfkw9+jT0ta2csjkJltpE4O1z7JyRnliy4Il0FeA/WA71mjvy0wrqJCwMhx AqHh6bJO7mBXlOcro1h4jf0NMmKQ= X-Google-Smtp-Source: AGHT+IGSNjbuiY+RQmNDwpmzaJ7vu6q1bOJKxH8DzrD5lClEL6/gdbE+PuV8ONIkdwWBzxEwQB4BkFOnOw6RUbtZ774= X-Received: by 2002:a05:6902:238a:b0:de4:6ace:7aa with SMTP id dp10-20020a056902238a00b00de46ace07aamr4812851ybb.17.1714138729719; Fri, 26 Apr 2024 06:38:49 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 References: In-Reply-To: Reply-To: autaut03@gmail.com Date: Fri, 26 Apr 2024 16:38:38 +0300 Message-ID: Subject: Re: [PHP-DEV] [RFC] [Discussion] #[\Deprecated] attribute again v1.3 To: =?UTF-8?Q?Benjamin_Au=C3=9Fenhofer?= Cc: Levi Morrison , PHP Internals , "tim@tideways-gmbh.com" Content-Type: multipart/alternative; boundary="00000000000014b2910617000627" From: autaut03@gmail.com (Alex Wells) --00000000000014b2910617000627 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Apr 26, 2024 at 11:01=E2=80=AFAM Benjamin Au=C3=9Fenhofer wrote: > After discussing with Mate shortly one reason for adding $since from a PH= P > project POV is that we do show the $since information in the generated > documentation output. > > Integrating with the work in progress to auto generate parts of the > function docs based on the stub files, having the $since attribute on the > stubs would allow to use this as the central information in code. Therefo= re > we would reconsider and add the $since argument to the Deprecated class. > > I am still partly on the side on Rowan ( > https://externals.io/message/123184#123206) that i don't find the > arguments for this parameter very convincing but at least there is a > use-case internally now that warrants adding it. > Hey. Before including the `since` parameter, please consider this: Let's assume the usual (or at least, the most common) development flow includes creating a separate branch where development happens before it's merged into the default branch. With that in mind, let's go through the flow: - tag 2.1.1 exists at some ref - the `master` branch is ahead of tag `2.1.1` and contains some unreleased, untagged changes - a new branch `deprecate-something` is created from `master` - a function is deprecated with the attribute: `#[Deprecated(since: '2.1.1')]` - a pull request is created from `deprecate-something` into `master`, but isn't merged yet - a new version is tagged and released - either `2.1.2`, `2.2.0` or `3.0.0` At this point `deprecate-something` contains an incorrectly specified `since: '2.1.1'` which needs to be updated by hand, or require additional tooling on top to update it automatically. Updating it by hand is tedious and may be needed to be done multiple times before the PR is merged. It's also not error-prone, as you may make a typo or just forget about the deprecation. This is also why Composer parses package version from the Git tags and advocates against specifying it manually: https://getcomposer.org/doc/04-schema.md#version --00000000000014b2910617000627 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Apr 26, 2024 at 11:01=E2=80=AFAM = Benjamin Au=C3=9Fenhofer <kontakt= @beberlei.de> wrote:
After discussing with Mate shortly one reason for adding $sinc= e from a PHP project POV is that we do show the $since information in the g= enerated documentation output.

Integrating with th= e work in progress to auto generate parts of the function docs based on the= stub files, having the $since attribute on the stubs would allow to use th= is as the central information in code. Therefore we would reconsider and ad= d the $since argument to the Deprecated class.

I a= m still partly on the side on Rowan (https://externals.io/message/123184#1232= 06) that i don't find the arguments for this parameter very convinc= ing but at least there is a use-case internally now that warrants adding it= .

Hey. Before including t= he `since` parameter, please consider this:

Let= 9;s assume the usual (or at least, the most common) development flow includ= es creating a separate branch where development happens before it's mer= ged into the default branch. With that in mind, let's go through the fl= ow:

=C2=A0 - tag 2.1.1 exists at some ref
=C2=A0 - = the `master` branch is ahead of tag `2.1.1` and contains some unreleased, u= ntagged changes
=C2=A0 - a new branch `deprecate-something` is cr= eated from `master`
=C2=A0 - a function is deprecated with the at= tribute: `#[Deprecated(since: '2.1.1')]`
=C2=A0 - a pull = request is created from `deprecate-something` into `master`, but isn't = merged yet
=C2=A0 - a new version is tagged and released - either= `2.1.2`, `2.2.0` or `3.0.0`

At this point `deprecate-somethi= ng` contains an incorrectly specified `since: '2.1.1'` which needs = to be updated by hand, or require additional tooling on top to update it au= tomatically.

Updating it by hand is tedious and may be needed to be = done multiple times before the PR is merged. It's also not error-prone,= as you may make a typo or just forget about the deprecation. This is also = why Composer parses package version from the Git tags and advocates against= specifying it manually:=C2=A0https://getcomposer.org/doc/04-schema.md#version
<= /div>
--00000000000014b2910617000627--