| Conditions | 5 |
| Paths | 2 |
| Total Lines | 30 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | public function getDerivativeDefinitions($basePluginDefinition) { |
||
| 17 | if ($this->entityTypeManager->hasDefinition('view')) { |
||
| 18 | $viewStorage = $this->entityTypeManager->getStorage('view'); |
||
| 19 | |||
| 20 | foreach (Views::getApplicableViews('graphql_display') as list($viewId, $displayId)) { |
||
| 21 | /** @var \Drupal\views\ViewEntityInterface $view */ |
||
| 22 | $view = $viewStorage->load($viewId); |
||
| 23 | /** @var \Drupal\graphql_views\Plugin\views\display\GraphQL $display */ |
||
| 24 | $display = $this->getViewDisplay($view, $displayId); |
||
| 25 | if (!$this->isPaged($display)) { |
||
| 26 | continue; |
||
| 27 | } |
||
| 28 | |||
| 29 | if (!$this->getRowResolveType($view, $displayId)) { |
||
|
|
|||
| 30 | continue; |
||
| 31 | } |
||
| 32 | |||
| 33 | $id = implode('-', [$viewId, $displayId, 'result', 'count']); |
||
| 34 | $this->derivatives[$id] = [ |
||
| 35 | 'id' => $id, |
||
| 36 | 'type' => 'Int', |
||
| 37 | 'parents' => [$display->getGraphQLResultName()], |
||
| 38 | 'view' => $viewId, |
||
| 39 | 'display' => $displayId, |
||
| 40 | ] + $this->getCacheMetadataDefinition($view, $display) + $basePluginDefinition; |
||
| 41 | } |
||
| 42 | } |
||
| 43 | |||
| 44 | return parent::getDerivativeDefinitions($basePluginDefinition); |
||
| 45 | } |
||
| 46 | |||
| 48 |
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
stringvalues, the empty string''is a special case, in particular the following results might be unexpected: