The following is an example requesting an explanation for one specific file in one specific filesystem, not helper classes generally.
The repo has a basic file structure which is clearly defined as follows:
app ├───dependencies.php ├───middleware.php ├───repositories.php ├───routes.php └───settings.php logs └───app.log public └───index.php src ├───Application │ ├───Actions │ │ ├───User │ │ │ ├───ListUsersAction.php │ │ │ ├───UserAction.php │ │ │ └───ViewUserAction.php │ │ ├───Action.php │ │ ├───ActionError.php │ │ └───ActionPayload.php │ ├───Handlers │ │ ├───HttpErrorHandler.php │ │ └───ShutdownHandler.php │ ├───Middleware │ │ └───SessionMiddleware.php │ └───ResponseEmitter │ └───ResponseEmitter.php ├───Domain │ ├───DomainException │ │ ├───DomainException.php │ │ └───DomainRecordNotFoundException.php │ └───User │ ├───User.php │ ├───UserNotFoundException.php │ └───UserRepository.php └───Infrastructure │ └───Persistence │ └───User │ └───InMemoryUserRepository.php tests var └───cache
I have added my own endpoints to this, for example a 'ViewWordAction' class which utilises a 'PostgresWordRepository' class and returns dictionary definitions for a single word found within a database table when the
This action is excluded from the file structure for clarity. There are various other endpoints which I will add, used to analyse word data.
I have a separate class called 'RegExHelper' which separates punctuation, recognises ends of sentences and other similar functions. In previous versions of my application, the file structure was a mess and did not follow proper conventions, so this and similar classes were stored in a 'Helper' folder within the
src directory. This class will be shared amongst various other classes across multiple endpoints.
I would like to know where to store this helper class and which naming conventions to use. I presume that the class should be refactored as 'RegExHander' and stored in a
src/Application/Handlers/RegEx directory, although I cannot find any guides or documentation which explain the proper file structure for this example.