Yii\helpers uniform classnames


(Matteo Cerioni) #1

I noticed that in the yii\helpers namespace there are classes with a name that has the suffix “helper” (like ArrayHelper or FileHelper) and other classes that do not have it (like Html or Url).
I do not like the syntax with the “helper” suffix, because there is a repetition in the class name.
What do you think ?


(Alexander Makarov) #2

Indeed, these could be unified.


(Miodrag Stojanović) #3

For instance :

ArrayHelper => Arrays
FileHelper => Files


(Yusup Hambali) #4

Yii, YiiArray, YiiString, YIIFile, YiiEtc


(Mehdi Achour) #5

FYI, so far we have extracted the following helpers:


(Fabrizio Caldarelli) #6

What about grouping all helper classes in \Yiisoft\Helpers namespace (package) ?

Are not there too much packages?

Whenever a new helper will require a new package, instead grouping all inside \Yiisoft\Helpers it will be simpler to mantain.


(Mehdi Achour) #7

It may appear like more package means more maintenance, but it will be easier/simpler maintenance in my opinion.

A good effect of having more packages is also that we can have strict requirements. Example: StringHelper requires ext.mbstring. ArrayHelper doesn’t.


(Fabrizio Caldarelli) #8

I’m agree with you about using strict requirements, but most of packages will have just one class (or two).

So the number of files about docker and testing will be greater than code :slight_smile:


(Alexander Makarov) #9

These won’t be changed often though so the cost is only in initializing these packages. We can afford it.