Skip to content

Instantly share code, notes, and snippets.

@adelowo
Created January 4, 2017 04:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adelowo/dda97d149ea1af1821e025477f962a71 to your computer and use it in GitHub Desktop.
Save adelowo/dda97d149ea1af1821e025477f962a71 to your computer and use it in GitHub Desktop.
Proposed Interface for gbowo library
<?php
namespace Gbowo\Contract\Plugin;
use Gbowo\Contract\Adapter\AdapterInterface;
interface PluginInterface
{
public function getPluginAccessor() : string;
public function setAdapter(AdapterInterface $adapter);
public function handle(...$args);
}
@adelowo
Copy link
Author

adelowo commented Feb 25, 2017

2 months after, i am thinking this is a pain.

The enforced handle method isn't. The ...$args is the real problem. Having spent the last few hours writing new plugins, doing $args[0] isn't just neat and the arguments are not really variadic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment