PSR-19 @triggers tag

42 views
Skip to first unread message

Magnar Ovedal Myrtveit

unread,
Nov 26, 2018, 6:00:29 AM11/26/18
to PHP Framework Interoperability Group
Would it be interesting to include a @triggers tag in PSR-19? This would be used with code that may call trigger_error() or other code that may trigger errors, such as filesize(), mime_content_type(), filemtime(), md5_file(), pspell_new(), etc. (There are really many!)

Examples would be:

@triggers E_ERROR Some text explaining what might trigger the error.

@triggers E_WARNING Some text explaining what might trigger the warning.

Chuck Burgess

unread,
Dec 5, 2018, 5:17:16 PM12/5/18
to php...@googlegroups.com
I'm accustomed to seeing such old-style error behavior wrapped by exceptions as much as possible, so I'm -1 on the idea.

Working Group / others, thoughts?


--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/a044b2ab-a22a-4385-9a26-95c2fc1ac121%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matthew Weier O'Phinney

unread,
Dec 5, 2018, 6:03:00 PM12/5/18
to php...@googlegroups.com
I'm against it, because it has a completely different connotation for me: I would have assumed any code documented with it would _trigger an event_ using some sort of event dispatcher.

In terms of using it to document trigger_error calls, I'm in agreement with Chuck: in most modern PHP I see, you raise exceptions instead. I only see `trigger_error` used for deprecation notices generally, and those can be documented with @deprecated instead.


For more options, visit https://groups.google.com/d/optout.


--

Larry Garfield

unread,
Dec 5, 2018, 11:38:02 PM12/5/18
to php...@googlegroups.com
At the risk of sounding like an AOL user of old, "me too". I agree with Chuck
and Matthew for the reasons they gave.

--Larry Garfield

On Wednesday, December 5, 2018 5:02:45 PM CST Matthew Weier O'Phinney wrote:
> I'm against it, because it has a completely different connotation for me: I
> would have assumed any code documented with it would _trigger an event_
> using some sort of event dispatcher.
>
> In terms of using it to document trigger_error calls, I'm in agreement with
> Chuck: in most modern PHP I see, you raise exceptions instead. I only see
> `trigger_error` used for deprecation notices generally, and those can be
> documented with @deprecated instead.
>
> On Wed, Dec 5, 2018 at 4:17 PM Chuck Burgess <demon...@gmail.com> wrote:
> > I'm accustomed to seeing such old-style error behavior wrapped by
> > exceptions as much as possible, so I'm -1 on the idea.
> >
> > Working Group / others, thoughts?
> > CRB
> > *about.me/ashnazg <http://about.me/ashnazg>*
signature.asc
Reply all
Reply to author
Forward
0 new messages