LinkFieldHandler::expand()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 6
Ratio 60 %

Importance

Changes 0
Metric Value
dl 6
loc 10
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
namespace Drupal\Driver\Fields\Drupal7;
4
5
/**
6
 * Link field handler for Drupal 7.
7
 */
8
class LinkFieldHandler extends AbstractHandler {
9
10
  /**
11
   * {@inheritdoc}
12
   */
13
  public function expand($values) {
14
    $return = [];
15 View Code Duplication
    foreach ($values as $value) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
16
      $return[$this->language][] = [
17
        'title' => $value[0],
18
        'url' => $value[1],
19
      ];
20
    }
21
    return $return;
22
  }
23
24
}
25