devel_wizard-2.x-dev/templates/spell/plugin_manager/definition_comparer.php.twig

templates/spell/plugin_manager/definition_comparer.php.twig
<?php

declare(strict_types=1);

namespace {{ definitionComparer.namespace }};

use Sweetchuck\Utils\Comparer\ComparerBase;

class {{ definitionComparer.class }} extends ComparerBase {

  /**
   * @param \{{ definition.classFqn }} $a
   * @param \{{ definition.classFqn }} $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;
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc