Created
June 8, 2018 13:46
-
-
Save mageekguy/23e3b94b2b3e4f81159d4d74cfe723f7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace foo; | |
class message | |
{ | |
… | |
} | |
namespace ubermuda; | |
interface message | |
{ | |
function ifIsSigned(callable $callable) :void; | |
} | |
namespace ubermuda\message; | |
use ubermuda\message; | |
class foo extends \foo\message | |
implements | |
message | |
{ | |
function ifIsSigned(callable $callable) :void | |
{ | |
if ($message->getProperty(\foo\MessageBuilder::PROPERTY_IS_SIGNED, false))) { | |
$callable(); | |
} | |
} | |
} | |
namespace ubermuda; | |
class bar | |
{ | |
function doSomethingWithMessage(message $message) :void | |
{ | |
$message->ifIsSigned(function() { | |
echo "Go nuts!"; | |
} | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment