Skip to content

Instantly share code, notes, and snippets.

@mageekguy
Created June 8, 2018 13:46
Show Gist options
  • Save mageekguy/23e3b94b2b3e4f81159d4d74cfe723f7 to your computer and use it in GitHub Desktop.
Save mageekguy/23e3b94b2b3e4f81159d4d74cfe723f7 to your computer and use it in GitHub Desktop.
<?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