Skip to content

Commit

Permalink
[#14349] - Adjusting the interfaces again
Browse files Browse the repository at this point in the history
  • Loading branch information
niden committed Sep 7, 2019
1 parent a92d80e commit 8ad287c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
16 changes: 8 additions & 8 deletions phalcon/Flash/AbstractFlash.zep
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ abstract class AbstractFlash extends AbstractDiAware implements FlashInterface
* $flash->error("This is an error");
*```
*/
public function error(string message) -> void
public function error(string message) -> string
{
this->{"message"}("error", message);
return this->{"message"}("error", message);
}

/**
Expand Down Expand Up @@ -147,9 +147,9 @@ abstract class AbstractFlash extends AbstractDiAware implements FlashInterface
* $flash->notice("This is an information");
*```
*/
public function notice(string message) -> void
public function notice(string message) -> string
{
this->{"message"}("notice", message);
return this->{"message"}("notice", message);
}

/**
Expand Down Expand Up @@ -220,9 +220,9 @@ abstract class AbstractFlash extends AbstractDiAware implements FlashInterface
* $flash->success("The process was finished successfully");
*```
*/
public function success(string message) -> void
public function success(string message) -> string
{
this->{"message"}("success", message);
return this->{"message"}("success", message);
}

/**
Expand Down Expand Up @@ -311,9 +311,9 @@ abstract class AbstractFlash extends AbstractDiAware implements FlashInterface
* $flash->warning("Hey, this is important");
*```
*/
public function warning(string message) -> void
public function warning(string message) -> string
{
this->{"message"}("warning", message);
return this->{"message"}("warning", message);
}


Expand Down
2 changes: 1 addition & 1 deletion phalcon/Flash/Direct.zep
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Direct extends AbstractFlash
/**
* Outputs a message
*/
public function message(string type, var message) -> string
public function message(string type, var message) -> string | null
{
return this->outputMessage(type, message);
}
Expand Down
10 changes: 5 additions & 5 deletions phalcon/Flash/FlashInterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,25 @@ interface FlashInterface
/**
* Shows a HTML error message
*/
public function error(string message) -> void;
public function error(string message) -> string;

/**
* Outputs a message
*/
public function message(string type, string message) -> void;
public function message(string type, string message) -> string | null;

/**
* Shows a HTML notice/information message
*/
public function notice(string message) -> void;
public function notice(string message) -> string;

/**
* Shows a HTML success message
*/
public function success(string message) -> void;
public function success(string message) -> string;

/**
* Shows a HTML warning message
*/
public function warning(string message) -> void;
public function warning(string message) -> string;
}
4 changes: 3 additions & 1 deletion phalcon/Flash/Session.zep
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Session extends AbstractFlash
/**
* Adds a message to the session flasher
*/
public function message(string type, string message) -> void
public function message(string type, string message) -> string | null
{
var messages;

Expand All @@ -70,6 +70,8 @@ class Session extends AbstractFlash
let messages[type][] = message;

this->setSessionMessages(messages);

return null;
}

/**
Expand Down

0 comments on commit 8ad287c

Please sign in to comment.