{ "uuid": [ { "value": "84a6f9be-759c-42ea-815b-6b29a90b7742" } ], "langcode": [ { "value": "en" } ], "type": [ { "target_id": "daily_email", "target_type": "node_type", "target_uuid": "8bde1f2f-eef9-4f2d-ae9c-96921f8193d7" } ], "revision_timestamp": [ { "value": "2025-05-11T09:00:26+00:00" } ], "revision_uid": [ { "target_type": "user", "target_uuid": "b8966985-d4b2-42a7-a319-2e94ccfbb849" } ], "revision_log": [], "status": [ { "value": true } ], "uid": [ { "target_type": "user", "target_uuid": "b8966985-d4b2-42a7-a319-2e94ccfbb849" } ], "title": [ { "value": "Suffixing names\n" } ], "created": [ { "value": "2023-12-10T00:00:00+00:00" } ], "changed": [ { "value": "2025-05-11T09:00:26+00:00" } ], "promote": [ { "value": false } ], "sticky": [ { "value": false } ], "default_langcode": [ { "value": true } ], "revision_translation_affected": [ { "value": true } ], "path": [ { "alias": "\/daily\/2023\/12\/10\/suffixing-names", "langcode": "en" } ], "body": [ { "value": "\n

When writing code, it's common to suffix the class name with the type of class it is.<\/p>\n\n

I do this often for most types of classes, such as Controllers, EventListeners, Factories, Repositories and Builders.<\/p>\n\n

However, I don't always for value objects and data transfer objects (DTOs).<\/p>\n\n

Also, I don't always suffix interfaces with Interface<\/code>.<\/p>\n\n

I've been re-reading the documentation for the Symfony Serializer component, which references both NameConverterInterface<\/code> and MyDto::class<\/code>.<\/p>\n\n

Whilst it does make the names more verbose, it does clarify what the class is used for.<\/p>\n\n

Symfony's coding standards and Drupal's PHP coding standards have conventions for this, but what do you think?<\/p>\n\n

Do you add suffixes to your class or interface names, or do you prefer the simplified versions?<\/p>\n\n ", "format": "full_html", "processed": "\n

When writing code, it's common to suffix the class name with the type of class it is.<\/p>\n\n

I do this often for most types of classes, such as Controllers, EventListeners, Factories, Repositories and Builders.<\/p>\n\n

However, I don't always for value objects and data transfer objects (DTOs).<\/p>\n\n

Also, I don't always suffix interfaces with Interface<\/code>.<\/p>\n\n

I've been re-reading the documentation for the Symfony Serializer component, which references both NameConverterInterface<\/code> and MyDto::class<\/code>.<\/p>\n\n

Whilst it does make the names more verbose, it does clarify what the class is used for.<\/p>\n\n

Symfony's coding standards and Drupal's PHP coding standards have conventions for this, but what do you think?<\/p>\n\n

Do you add suffixes to your class or interface names, or do you prefer the simplified versions?<\/p>\n\n ", "summary": null } ] }