src/Sonic/Flysystem/Plugin/Plugin.php
public function handle($path = '')
    {
        // Try and read the file
        $file = \League\Flysystem\Util::pathinfo($path);

        // Include plugin file
        include_once(getcwd() . '/' . $file['path']);

        // Check class implements correct interface
        $parents = class_parents($file['filename']);
        if (isset($parents['Sonic\PluginAbstract']) === FALSE) {
            throw new \UnexpectedValueException('Plugin does not implement Sonic\PluginAbstract');
        }

        return new $file['filename'];
    }
public function handle($path = '')
    {
        // Try and read the file
        $file = \League\Flysystem\Util::pathinfo($path);

        // Include plugin file
        include_once(getcwd() . '/' . $file['path']);

        // Check class implements correct interface
        $parents = class_parents($file['filename']);
        if (isset($parents['Sonic\PluginAbstract']) === FALSE) {
            throw new \UnexpectedValueException('Plugin does not implement Sonic\PluginAbstract');
        }

        return new $file['filename'];
    }
Plugin handler

@param  string $path
@return \Sonic\PluginInterface