@Chris D, I write everything adequately, but maybe somewhere a bit cruel (but in the future it will be useful to him). But this time I even praised the developer, since his level has really grown and has already become fewer at times times wrong, so besides this, his code has become nicer and smarter.
@Snog, so here it is possible. And the truth is so beautiful and comfortable? And at the same time, when changing templates, even adding new functions or changes inside a block will not break when updating and will be supported both with new releases and with old ones. In this case, you do not copy-paste the engine and received only advantages. Yes, regular expressions can be complicated, but they are worth learning and practicing with them. Because on some regular expressions we can make better quality and without problems even make parsers from one format to another.
For example:
View attachment 207446
We just found 3 blocks and in front of them inserted 3 macros that add their own. Here the same principle and in addition, it will be possible to omit the requirement 2.1 as well as 2.0 it will be fine then to work. Only then he finds these blocks and wraps them in the conditions. And all because the search for regular expression and data insertion, what is found and the initial tags will be similar in search with 2.0.
I showed in this example and said how to do that would be more correct.
I do not want to humiliate the developer or something else. I showed only the best opportunity and the output that will be faster, more convenient and more profitable. The ideal code does not exist and never will be, because every developer has experience over time, and this experience is taken from practice and writing code not a dozen times. I am not perfect either, and there are mistakes and problems, but I try to get better. And with what you wrote a year ago and after practicing writing applications for a year, you yourself look at your code and be horrified how you could write this. When in the future you implement or rewrite code.
In this topic, I just pointed to the small minuses of development and which would be worth correcting.
After I was told that I did the same thing in the engine, I wrote that it is worth making a new modification, and not to make a modification that copies the paste engine only by adding over its condition.
If I hurt someone badly or offended, I beg your pardon. Just XF is considered to be a really smart engine. But here are some additions that just spoil the picture and that they would not say bad things about the engine and the corresponding messages to the authors are needed in order for them to put their code in the code. In addition to this, I don’t know the reason for rejecting the same chic offer that will make code style for add-on developers like XF:
Re-Post of https://xf2demo.xenforo.com/threads/official-php-cs-fixer-config.3023/ so it does not eventually get lost: It would be great if you could provide an official .php_cs.dist which Add-on developers could use to verify that their code is fully compliant with XF Code Style.
xenforo.com
But this is their decision and most likely there are reasons for that.