devel_wizard-2.x-dev/src/Spell/SpellDefinitionComparer.php
src/Spell/SpellDefinitionComparer.php
<?php
declare(strict_types=1);
namespace Drupal\devel_wizard\Spell;
use Sweetchuck\Utils\Comparer\ComparerBase;
class SpellDefinitionComparer extends ComparerBase {
/**
* @param \Drupal\devel_wizard\Spell\SpellDefinition $a
* @param \Drupal\devel_wizard\Spell\SpellDefinition $b
*/
protected function setResult($a, $b): static {
$this->result = strnatcasecmp(
(string) $a->getCategory(),
(string) $b->getCategory(),
);
if ($this->result) {
return $this;
}
$this->result = strnatcasecmp(
(string) $a->getLabel(),
(string) $b->getLabel(),
);
return $this;
}
}
