Skip to content

Commit d9d0571

Browse files
committed
add: IsDefault and IsNotDefault methods in VersionComponent.
1 parent 66505ed commit d9d0571

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

src/VersionComponent.php

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
/**
2222
* Representa un componente de un número de Version.
2323
* Extiende la clase IntString, pero restringe los valores que puede tomar.
24-
*
25-
*
24+
*
25+
*
2626
* @package NelsonMartell
2727
* @author Nelson Martell (@yahoo.es: nelson6e65-dev)
2828
* */
@@ -78,5 +78,30 @@ public static function Parse($value) {
7878
return $r;
7979
}
8080

81+
/**
82+
* Determina si este componente tiene los valores predeterminados (0).
83+
*
84+
*
85+
* @return boolean
86+
* */
87+
public function IsDefault() {
88+
if ($this->IntValue == 0){
89+
if ($this->StringValue == '') {
90+
return true;
91+
}
92+
}
93+
94+
return false;
95+
}
96+
97+
/**
98+
* Determina si este componente NO tiene los valores predeterminados.
99+
*
100+
*
101+
* @return boolean
102+
* */
103+
public function IsNotDefault() {
104+
return !$this->IsDefault();
105+
}
81106
}
82107
}

0 commit comments

Comments
 (0)