/** * Tests whether isOfElementType works as expected. * * @return void */ public function testIsOfElementType() { $stdClassObjectSet = new ObjectSet(stdClass::class); $this->assertTrue($stdClassObjectSet->isOfElementType(stdClass::class)); $objectSet = new ObjectSet(); $this->assertFalse($objectSet->isOfElementType(stdClass::class)); }
/** * Sets post-filter plugins. * * Throws an exception in case the given post-filters are not of type * \Ableron\Core\Template\Plugins\Interfaces\PostFilterPluginInterface. * * @param \Ableron\Lib\Collections\Implementations\ObjectSet $postFilters Post-filter plugins to apply after the actual compilation * @throws \Ableron\Core\Exception\SystemException * @return void */ private function setPostFilters(ObjectSet $postFilters) { // check element type of object set if (!$postFilters->isOfElementType(PostFilterPluginInterface::class)) { throw new SystemException(sprintf('Unable to set post-filter plugins: Plugins not of type %s', PostFilterPluginInterface::class), 0, E_USER_ERROR, __FILE__, __LINE__); } $this->postFilters = $postFilters; }