php-generator icon indicating copy to clipboard operation
php-generator copied to clipboard

Fix namespace sorting of capitalcase

Open Jeroeny opened this issue 3 years ago • 2 comments

  • bug fix
  • BC break? no

Before

use App\QueryCostSet;
use App\QueryCostsBootstrapped;

After

use App\QueryCostsBootstrapped;
use App\QueryCostSet;

Jeroeny avatar Oct 13 '22 07:10 Jeroeny

I think that this is better:

use App\QueryCostP;
use App\QueryCostR;
use App\QueryCostT;
use App\QueryCostsBootstrapped;
use App\QueryCostsXyz;

than this:

use App\QueryCostP;
use App\QueryCostR;
use App\QueryCostsBootstrapped;
use App\QueryCostsXyz;
use App\QueryCostT;

dg avatar Oct 13 '22 12:10 dg

Hi @dg ! Do you think this PR will merged at some point ? At the moment I hack the uasort(...) function by "strtolowering" the compared values in PhpNamespace.php

uasort(
    $this->aliases[$of],
    fn(string $a, string $b): int => strtr(strtolower($a), '\\', ' ') <=> strtr(strtolower($b), '\\', ' '),
);

symfonyaml avatar Jan 13 '24 16:01 symfonyaml