> Do you think strcmp($a->getRealpath(), $b->getRealpath()) < 0 ? -1 : 1; is useful or return directly is enough ?

I was not sure, but you right, in the doc they show an example where they send direcly the result of strcmp.