Including security review as a submodule - with patched for Yaffs.
[yaffs-website] / web / modules / contrib / entity_browser / src / WidgetsLazyPluginCollection.php
1 <?php
2
3 namespace Drupal\entity_browser;
4
5 use Drupal\Core\Plugin\DefaultLazyPluginCollection;
6
7 /**
8  * A collection of entity browser widgets.
9  */
10 class WidgetsLazyPluginCollection extends DefaultLazyPluginCollection {
11
12   /**
13    * Provides uasort() callback to sort plugins.
14    */
15   public function sortHelper($a, $b) {
16     $weight_a = $this->get($a)->getWeight();
17     $weight_b = $this->get($b)->getWeight();
18
19     return $weight_a < $weight_b ? -1 : 1;
20   }
21
22 }