Skip to content

Instantly share code, notes, and snippets.

@mageekguy
Created Jun 8, 2018
Embed
What would you like to do?
<?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