Skip to main content
Post Closed as "Duplicate" by leymannx, avpaderno 8
added 229 characters in body
Source Link
Adrian Cid Almaguer
  • 18.5k
  • 14
  • 79
  • 133

I have a custom module with some utility (can be used for other modules) and internal (can be used only for the module) functions inside, so I decide to place this functions in another file.

But reading the coding standards I can't find a place for this, I have as a candidate src/Utility/ for the utility functions and then create some files related to the utility category like in core (Utility classes and functions). This will be made in a new module and this new module will be added as dependency, in this way I will have in only one place all the common utilities functions and the other modules (that can need the functions) can add this new module as a dependency too.

But for the internal functions I'm thinking to use /src/Utility/InternalFunctions.php as file for this.

So, where is the correct place for the utility and internal functions for a custom module?

I have a custom module with some utility (can be used for other modules) and internal (can be used only for the module) functions inside, so I decide to place this functions in another file.

But reading the coding standards I can't find a place for this, I have as a candidate src/Utility/ for the utility functions and then create some files related to the utility category like in core (Utility classes and functions).

But for the internal functions I'm thinking to use /src/Utility/InternalFunctions.php as file for this.

So, where is the correct place for the utility and internal functions for a custom module?

I have a custom module with some utility (can be used for other modules) and internal (can be used only for the module) functions inside, so I decide to place this functions in another file.

But reading the coding standards I can't find a place for this, I have as a candidate src/Utility/ for the utility functions and then create some files related to the utility category like in core (Utility classes and functions). This will be made in a new module and this new module will be added as dependency, in this way I will have in only one place all the common utilities functions and the other modules (that can need the functions) can add this new module as a dependency too.

But for the internal functions I'm thinking to use /src/Utility/InternalFunctions.php as file for this.

So, where is the correct place for the utility and internal functions for a custom module?

added 9 characters in body
Source Link
Adrian Cid Almaguer
  • 18.5k
  • 14
  • 79
  • 133

I have a custom module with some utility (can be used for other modules) and internal (can be used only for the module) functions inside, so I decide to place this functions in another file.

But reading the coding standards I can't find a place for this, I have as a candidate src/Utility/ for the utility functions and then create some files related to the utility category like in core (Utility classes and functions).

But for the internal functions I'm thinking to use /src/Utility/InternalInternalFunctions.php as file for this.

So, where is the correct place for the utility and internal functions for a custom module?

I have a custom module with some utility (can be used for other modules) and internal (can be used only for the module) functions inside, so I decide to place this functions in another file.

But reading the coding standards I can't find a place for this, I have as a candidate src/Utility/ for the utility functions and then create some files related to the utility category like in core (Utility classes and functions).

But for the internal functions I'm thinking to use /src/Utility/Internal.php as file for this.

So, where is the correct place for the utility and internal functions for a custom module?

I have a custom module with some utility (can be used for other modules) and internal (can be used only for the module) functions inside, so I decide to place this functions in another file.

But reading the coding standards I can't find a place for this, I have as a candidate src/Utility/ for the utility functions and then create some files related to the utility category like in core (Utility classes and functions).

But for the internal functions I'm thinking to use /src/Utility/InternalFunctions.php as file for this.

So, where is the correct place for the utility and internal functions for a custom module?

Source Link
Adrian Cid Almaguer
  • 18.5k
  • 14
  • 79
  • 133

Where to place the utility and internal functions for a custom module?

I have a custom module with some utility (can be used for other modules) and internal (can be used only for the module) functions inside, so I decide to place this functions in another file.

But reading the coding standards I can't find a place for this, I have as a candidate src/Utility/ for the utility functions and then create some files related to the utility category like in core (Utility classes and functions).

But for the internal functions I'm thinking to use /src/Utility/Internal.php as file for this.

So, where is the correct place for the utility and internal functions for a custom module?