@@ -39,43 +39,31 @@ public function replies() {
3939 * @return {String}: the concatenation of the replies
4040 */
4141 public function joinedReplies ($ separator =' ' ) {
42- if ($ this ->replies ) {
43- return (join ($ separator , $ this ->replies ));
44- }
45-
46- return (null );
42+ return ($ this ->replies ? join ($ separator , $ this ->replies ) : null )
4743 }
4844
4945 /**
5046 * Returns all the action whose name matches the parameter
5147 * @return {Array}: returns an array of action, or null
5248 */
5349 public function action () {
54- if ($ this ->action ) {
55- return ($ this ->action || null );
56- }
50+ return ($ this ->action || null );
5751 }
5852
5953 /**
6054 * Returns the first nextActions whose name matches the parameter
6155 * @return {Array}: returns an array of first nextActions, or null
6256 */
6357 public function nextAction () {
64- if ($ this ->nextActions ) {
65- return ($ this ->nextActions [0 ]);
66- }
67-
68- return (null );
58+ return (count ($ this ->nextAction ) > 0 ? $ this ->nextAction [0 ] : []);
6959 }
7060
7161 /**
7262 * Returns all nextActions
7363 * @return {Array}: returns an array of nextActions, or null
7464 */
7565 public function nextActions () {
76- if ($ this ->nextActions ) {
77- return ($ this ->nextActions || $ res = []);
78- }
66+ return ($ this ->nextActions || []);
7967 }
8068
8169 /**
@@ -86,7 +74,7 @@ public function nextActions() {
8674 public function memory ($ name =null ) {
8775 if ($ name === null ) {
8876 return ($ this ->memory );
89- } else if ($ this ->memory -> $ name ) {
77+ } else if (array_key_exists ( $ this ->memory , $ name) ) {
9078 return ($ this ->memory ->$ name );
9179 } else {
9280 return (null );
0 commit comments