I've been working on a project in PHP and I've come across the need to add some cross-cutting concerns like logging and exception handling to specific methods or classes in my code. I was doing some research and stumbled upon the concept of attributes. I know that attributes can be used to add metadata to classes, properties, and methods, but I'm not sure if they can also be used to achieve what I'm looking for.
So, my question is: Can attributes in PHP be used to add cross-cutting logging or exception handling to specific methods or classes? I would really appreciate it if someone could provide some insights or examples on how to accomplish this using attributes.
Thanks in advance!