GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Copier   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 7
dl 0
loc 23
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A makeCopy() 0 7 2
1
<?php
2
3
namespace Drupal\df_tools_blocks;
4
5
use Drupal\replicate\Replicator;
6
7
/**
8
 * Class Copier.
9
 *
10
 * @package Drupal\df_tools_blocks
11
 */
12
class Copier {
13
14
  /**
15
   * Drupal\replicate\Replicator definition.
16
   *
17
   * @var \Drupal\replicate\Replicator
18
   */
19
  protected $replicator;
20
21
  /**
22
   * Constructor.
23
   */
24
  public function __construct(Replicator $replicator) {
25
    $this->replicator = $replicator;
26
  }
27
28
  public function makeCopy($entity, $options = null) {
0 ignored issues
show
Unused Code introduced by
The parameter $options is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

28
  public function makeCopy($entity, /** @scrutinizer ignore-unused */ $options = null) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
29
    // Copy and return the entity.
30
    if ($copy = $this->replicator->replicateEntity($entity)) {
31
      return $copy;
32
    }
33
    else {
34
      return false;
35
    }
36
  }
37
38
}
39