/** * @param DAOConnected $object * @param string $level * @throws InvalidArgumentException */ public function __construct($object, $level = LogLevel::DEBUG) { parent::__construct($level); if (!$object instanceof DAOConnected) { throw new InvalidArgumentException(); } $this->object = $object; }
/** * @param string $filename * @param string $level * @throws InvalidArgumentException */ public function __construct($filename, $level = LogLevel::DEBUG) { parent::__construct($level); if (is_string($filename)) { $this->filename = $filename; } else { throw new InvalidArgumentException('Invalid type'); } $this->setDecorator(new StreamDecorator()); }