Completed
Push — master ( a02710...7ee086 )
by Jelle
09:44
created

PropertyMapDefinition   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 25
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A addPropertyMap() 0 9 1
A getPropertyMaps() 0 3 1
1
<?php
2
3
namespace TheSportsDb\PropertyMapper;
4
5
/**
6
 * Describes a property map definition.
7
 *
8
 * @author Jelle Sebreghts
9
 */
10
class PropertyMapDefinition {
11
12
  protected $propertyMaps = [];
13
14
  public function addPropertyMap(PropertyDefinition $source, PropertyDefinition $destination, callable $transform = NULL, callable $reverse = NULL) {
15
    $this->propertyMaps[] = new PropertyMap(
16
      $source,
17
      $destination,
18
      $transform,
19
      $reverse
20
    );
21
    return $this;
22
  }
23
24
  /**
25
   * Gets the property maps.
26
   * 
27
   * @return \TheSportsDb\PropertyMapper\PropertyMap[]
28
   */
29
  public function getPropertyMaps() {
30
    return $this->propertyMaps;
31
  }
32
33
34
}
35