Ok I understand what you mean, however my entire function is no the same as two require_once, it is that way for a few justified reasons:
Safety: I am actually validating for the “unknown” with file_exists(), I am phisically checking if the file actually exists in the filesystem, there’s no place for the “unknown” here at all. It is the safest check within the current context. Would ever file_exists return true for a wrong or misspelled path?
Reusability: The function is part of my framework, this way I can keep adding files to the list for future themes, and the logic for processing every file won’t be duplicated and will be less susceptible to errors, imagine if in the future the array of files reaches 20 items, I would need to duplicate 20 times any logic for processing / validating each file. This way I can have a single place (within the foreach) to manipulate or process or validate the files, instead of duplicating the entire logic for each file 20 times, which is against all coding standards and principles.
I am a software engineer and I have been programming for 17 years now, I know what I am doing. The point is unnecessary, nonsense and unjustified, not yours but his.
I see your point ThemeSLR your suggestion is to simply get over it and make the reviewer happy, and I appreciate that, but I refuse to contribute to a digital dictatorship, in which you have to look down with no chance to stand up for your rights and say your own word, when you really have a reason, and be punished if you dare.