File tree Expand file tree Collapse file tree 4 files changed +29
-7
lines changed Expand file tree Collapse file tree 4 files changed +29
-7
lines changed Original file line number Diff line number Diff line change @@ -133,17 +133,37 @@ static function getInvalidTypeMessage() {
133
133
}
134
134
135
135
/**
136
- * @return string [message as a string]
136
+ * @return string [Message as a string]
137
137
*/
138
138
static function getStartDateMustBeBeforeEndDateMessage () {
139
139
return Strings::getString ('message_start_date_must_be_before_end_date ' );
140
140
}
141
141
142
142
/**
143
- * @return string [message as a string]
143
+ * @return string [Message as a string]
144
144
*/
145
- static function getDayCountConventionNotDefined () {
145
+ static function getDayCountConventionNotDefinedMessage () {
146
146
return Strings::getString ('message_day_count_convention_not_defined ' );
147
147
}
148
+
149
+ /**
150
+ * @return string [Message as a string]
151
+ */
152
+ static function getPropresultarrayNotSuppliedMessage () {
153
+ return Strings::getString ('message_propresultarray_not_supplied ' );
154
+ }
155
+
156
+ /**
157
+ * @param $methodName [Name of the method]
158
+ * @param $className [Name of the class]
159
+ * @return string [Concatenated message as a string]
160
+ */
161
+ static function getMethodDoesNotExistMessage ($ methodName , $ className ) {
162
+ return Strings::getFormattedString (
163
+ 'message_method_does_not_exist ' ,
164
+ $ methodName ,
165
+ $ className
166
+ );
167
+ }
148
168
}
149
169
}
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ public final function getResultAsArray(array $propResultArray = null) {
45
45
if ($ this ->propResultArray !== null && is_array ($ this ->propResultArray )) {
46
46
$ propResultArray = $ this ->propResultArray ;
47
47
} else {
48
- error_log (' $propResultArray has not been supplied neither by the argument, nor by the class field ' );
48
+ error_log (ErrorMessages:: getPropresultarrayNotSuppliedMessage () );
49
49
return false ;
50
50
}
51
51
}
@@ -58,7 +58,7 @@ public final function getResultAsArray(array $propResultArray = null) {
58
58
if (method_exists ($ this , $ propGetter )) {
59
59
$ processedArray [is_string ($ key ) ? $ key : $ prop ] = call_user_func (array ($ this , $ propGetter ));
60
60
} else {
61
- error_log (" Method ' " . $ propGetter . " ()' doesn't exist in the class " . get_class ($ this ));
61
+ error_log (ErrorMessages:: getMethodDoesNotExistMessage ( $ propGetter, get_class ($ this ) ));
62
62
}
63
63
}
64
64
if (is_array ($ prop )) {
Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ public static function getCurrentDayCountConvention() {
131
131
return $ dayCountConvention ;
132
132
}
133
133
134
- throw new Exception (ErrorMessages::getDayCountConventionNotDefined ());
134
+ throw new Exception (ErrorMessages::getDayCountConventionNotDefinedMessage ());
135
135
}
136
136
137
137
/**
Original file line number Diff line number Diff line change 16
16
'message_class_not_defined ' => 'Class %s not defined ' ,
17
17
'message_invalid_type_specified ' => 'Invalid type specified! ' ,
18
18
'message_start_date_must_be_before_end_date ' => 'Start date has to be lower than the end date! ' ,
19
- 'message_day_count_convention_not_defined ' => 'The day count convention is not defined properly in the config! '
19
+ 'message_day_count_convention_not_defined ' => 'The day count convention is not defined properly in the config! ' ,
20
+ 'message_propresultarray_not_supplied ' => '$propResultArray has not been supplied neither by the argument, nor by the class field ' ,
21
+ 'message_method_does_not_exist ' => 'Method %s doesn \'t exist in the class %s! '
20
22
);
You can’t perform that action at this time.
0 commit comments