Yii\helpers uniform classnames

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 ?

6 Likes

Indeed, these could be unified.

1 Like

For instance :

ArrayHelper => Arrays
FileHelper => Files

2 Likes

Yii, YiiArray, YiiString, YIIFile, YiiEtc

FYI, so far we have extracted the following helpers:

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.

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.

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:

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