Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | |
0.00% |
0 / 3 |
|
0.00% |
0 / 3 |
|
0.00% |
0 / 3 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
| IslandLifecycleReloadTrait | |
0.00% |
0 / 3 |
|
0.00% |
0 / 3 |
|
0.00% |
0 / 3 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 1 |
| onHistoryChange | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| onRestore | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| onRevert | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Drupal\display_builder\Island; |
| 6 | |
| 7 | use Drupal\display_builder\InstanceInterface; |
| 8 | |
| 9 | /** |
| 10 | * Reload implementation for IslandLifecycleEventsInterface methods. |
| 11 | * |
| 12 | * Provides onHistoryChange, onRestore, and onRevert handlers that all |
| 13 | * delegate to reloadWithGlobalData(), which the using island plugin must |
| 14 | * provide. |
| 15 | * |
| 16 | * Use this trait when an island should fully reload its content in response |
| 17 | * to history pointer changes, state restores, or entity view reverts. |
| 18 | */ |
| 19 | trait IslandLifecycleReloadTrait { |
| 20 | |
| 21 | /** |
| 22 | * {@inheritdoc} |
| 23 | */ |
| 24 | public function onHistoryChange(InstanceInterface $instance): array { |
| 25 | return $this->reloadWithGlobalData($instance); |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * {@inheritdoc} |
| 30 | */ |
| 31 | public function onRestore(InstanceInterface $instance): array { |
| 32 | return $this->reloadWithGlobalData($instance); |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * {@inheritdoc} |
| 37 | */ |
| 38 | public function onRevert(InstanceInterface $instance): array { |
| 39 | return $this->reloadWithGlobalData($instance); |
| 40 | } |
| 41 | |
| 42 | } |
Below are the source code lines that represent each code branch as identified by Xdebug. Please note a branch is not
necessarily coterminous with a line, a line may contain multiple branches and therefore show up more than once.
Please also be aware that some branches may be implicit rather than explicit, e.g. an if statement
always has an else as part of its logical flow even if you didn't write one.
| 24 | public function onHistoryChange(InstanceInterface $instance): array { |
| 25 | return $this->reloadWithGlobalData($instance); |
| 26 | } |
| 31 | public function onRestore(InstanceInterface $instance): array { |
| 32 | return $this->reloadWithGlobalData($instance); |
| 33 | } |
| 38 | public function onRevert(InstanceInterface $instance): array { |
| 39 | return $this->reloadWithGlobalData($instance); |
| 40 | } |