Code Coverage  | 
     ||||||||||
Classes and Traits  | 
      Functions and Methods  | 
      Lines  | 
     ||||||||
| Total |         | 
      0.00%  | 
      0 / 1  | 
              | 
      0.00%  | 
      0 / 1  | 
      CRAP |         | 
      0.00%  | 
      0 / 1  | 
     
| ImageEffectPluginCollection |         | 
      0.00%  | 
      0 / 1  | 
              | 
      50.00%  | 
      1 / 2  | 
      20 |         | 
      0.00%  | 
      0 / 1  | 
     
| get |         | 
      0.00%  | 
      0 / 1  | 
      2 |         | 
      0.00%  | 
      0 / 1  | 
     |||
| sortHelper |         | 
      100.00%  | 
      1 / 1  | 
      3 |         | 
      100.00%  | 
      0 / 0  | 
     |||
| <?php | |
| /** | |
| * @file | |
| * Contains \Drupal\image\ImageEffectPluginCollection. | |
| */ | |
| namespace Drupal\image; | |
| use Drupal\Core\Plugin\DefaultLazyPluginCollection; | |
| /** | |
| * A collection of image effects. | |
| */ | |
| class ImageEffectPluginCollection extends DefaultLazyPluginCollection { | |
| /** | |
| * {@inheritdoc} | |
| * | |
| * @return \Drupal\image\ImageEffectInterface | |
| */ | |
| public function &get($instance_id) { | |
| return parent::get($instance_id); | |
| } | |
| /** | |
| * {@inheritdoc} | |
| */ | |
| public function sortHelper($aID, $bID) { | |
| $a_weight = $this->get($aID)->getWeight(); | |
| $b_weight = $this->get($bID)->getWeight(); | |
| if ($a_weight == $b_weight) { | |
| return 0; | |
| } | |
| return ($a_weight < $b_weight) ? -1 : 1; | |
| } | |
| } |