DataSift\Storyplayer\Output::getActivePluginInSlot PHP Method

getActivePluginInSlot() public method

return the active plugin in the named slot
public getActivePluginInSlot ( string $slotName ) : OutputPlugin | null
$slotName string
return DataSift\Storyplayer\OutputLib\OutputPlugin | null
    public function getActivePluginInSlot($slotName)
    {
        // enforce our inputs
        Contract::RequiresValue($slotName, is_string($slotName));
        // do we have a plugin in this slot?
        if (isset($this->plugins[$slotName])) {
            return $this->plugins[$slotName];
        }
        // no, we do not
        return null;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @covers DataSift\Storyplayer\Output::getActivePluginInSlot()
  */
 public function testReturnsNullIfNoActivePluginInSlot()
 {
     // ----------------------------------------------------------------
     // setup the test
     $obj = new Output();
     $slotName = 'unit-test';
     // ----------------------------------------------------------------
     // perform the change
     // ----------------------------------------------------------------
     // test the results
     $activePlugin = $obj->getActivePluginInSlot($slotName);
     $this->assertNull($activePlugin);
 }