Completed
Push — work-fleets ( 7aaf68...e155c0 )
by SuperNova.WS
06:30
created

PropertyHiderInArray::isContainerEmpty()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
1
<?php
2
3
/**
4
 * Class PropertyHiderInArray
5
 *
6
 * Holding properties in internal container
7
 */
8
class PropertyHiderInArray extends PropertyHider {
9
10
  protected $_data = array();
11
12
  /**
13
   * Method checks if action is available for named property
14
   *
15
   * @param string $name
16
   * @param string $action
17
   *
18
   * @return bool
19
   */
20
  protected function isPropertyActionAvailable($name, $action = '') {
21
    // By default all action available for existing properties
22
    return true;
23
  }
24
25
  /**
26
   * Internal method that make real changes to property value
27
   * May be override in child class
28
   *
29
   * @param string $name
30
   * @param mixed  $value
31
   *
32
   * @return mixed
33
   */
34
  protected function setProperty($name, $value) {
35
    // TODO: Change property only if value differs ????
0 ignored issues
show
Unused Code Comprehensibility introduced by
48% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
36
//      if($this->{$this->getPhysicalPropertyName($name)} !== $value) {
37
//      }
38
    return $this->_data[$name] = $value;
39
  }
40
41
  /**
42
   * Internal method that make really reads property value
43
   * May be override in child class
44
   *
45
   * @param string $name
46
   * @param mixed  $value - ignored. Used for compatibility
47
   *
48
   * @return mixed
49
   */
50
  protected function getProperty($name, $value = null) {
51
    return $this->_data[$name];
52
  }
53
54
  public function __isset($name) {
55
    return isset($this->_data[$name]);
56
  }
57
58
  /**
59
   * Is container empty
60
   *
61
   * @return boolean
62
   */
63
  public function isContainerEmpty() {
64
    return empty($this->_data);
65
  }
66
67
}
68