File tree Expand file tree Collapse file tree 3 files changed +41
-17
lines changed Expand file tree Collapse file tree 3 files changed +41
-17
lines changed Original file line number Diff line number Diff line change @@ -72,22 +72,34 @@ public function getRawValue()
72
72
{
73
73
return $ this ->raw ;
74
74
}
75
+
76
+ public function getValueOrDefault ()
77
+ {
78
+ if ($ this ->value !== null )
79
+ return $ this ->value ;
80
+
81
+ return $ this ->default ;
82
+ }
75
83
84
+ /**
85
+ * @deprecated since version 1.0
86
+ * @see getSafeValue, getValueOrDefault
87
+ */
76
88
public function getActualValue ()
77
89
{
78
- if (null !== $ this ->value )
90
+ if ($ this ->value !== null )
79
91
return $ this ->value ;
80
92
elseif ($ this ->imported )
81
93
return $ this ->raw ;
82
94
83
95
return $ this ->default ;
84
96
}
85
-
97
+
86
98
public function getSafeValue ()
87
99
{
88
100
if ($ this ->imported )
89
101
return $ this ->value ;
90
-
102
+
91
103
return $ this ->default ;
92
104
}
93
105
Original file line number Diff line number Diff line change @@ -57,25 +57,24 @@ public function getRawValue()
57
57
return $ this ->primitive ->getRawValue ();
58
58
}
59
59
60
+
61
+ public function getValueOrDefault ()
62
+ {
63
+ return $ this ->primitive ->getValueOrDefault ();
64
+ }
65
+
60
66
/**
61
67
* @deprecated by getFormValue
68
+ * since version 1.0 by getValueOrDefault
62
69
**/
63
70
public function getActualValue ()
64
71
{
65
- if (null !== $ this ->primitive ->getValue ())
66
- return $ this ->primitive ->getValue ();
67
- elseif ($ this ->primitive ->isImported ())
68
- return $ this ->primitive ->getRawValue ();
69
-
70
- return $ this ->primitive ->getDefault ();
72
+ return $ this ->primitive ->getActualValue ();
71
73
}
72
74
73
75
public function getSafeValue ()
74
76
{
75
- if ($ this ->primitive ->isImported ())
76
- return $ this ->primitive ->getValue ();
77
-
78
- return $ this ->primitive ->getDefault ();
77
+ return $ this ->primitive ->getSafeValue ();
79
78
}
80
79
81
80
public function getFormValue ()
Original file line number Diff line number Diff line change @@ -53,17 +53,30 @@ public function import($scope)
53
53
54
54
return ($ this ->value !== array ());
55
55
}
56
-
56
+
57
+ public function getValueOrDefault ()
58
+ {
59
+ if (is_array ($ this ->value ) && $ this ->value [0 ])
60
+ return $ this ->value ;
61
+
62
+ return array ($ this ->default );
63
+ }
64
+
65
+ /**
66
+ * @deprecated deprecated since version 1.0
67
+ * @see getSafeValue, getValueOrDefault
68
+ * @return type
69
+ */
57
70
public function getActualValue ()
58
71
{
59
72
if (is_array ($ this ->value ) && $ this ->value [0 ])
60
73
return $ this ->value ;
61
74
elseif (is_array ($ this ->raw ) && $ this ->raw [0 ])
62
75
return $ this ->raw ;
63
-
76
+
64
77
return array ($ this ->default );
65
78
}
66
-
79
+
67
80
public static function stringToTimeList ($ string )
68
81
{
69
82
$ list = array ();
@@ -86,4 +99,4 @@ public function exportValue()
86
99
throw new UnimplementedFeatureException ();
87
100
}
88
101
}
89
- ?>
102
+ ?>
You can’t perform that action at this time.
0 commit comments