Files
ik-codex/src/Log/LogInterface.php
indifferentketchup 66a2fcc5f3 Rename namespace Aternos\Codex to IndifferentKetchup\Codex
Bulk substitution across all PHP files in src/ and test/. Covers
namespace declarations, use statements, fully-qualified class
references, and @package PHPDoc tags. No logic changes.
2026-04-30 15:13:52 +00:00

110 lines
2.3 KiB
PHP

<?php
namespace IndifferentKetchup\Codex\Log;
use ArrayAccess;
use IndifferentKetchup\Codex\Log\File\LogFileInterface;
use IndifferentKetchup\Codex\Parser\ParserInterface;
use Countable;
use Iterator;
use JsonSerializable;
/**
* Interface LogInterface
*
* @package IndifferentKetchup\Codex\Log
*/
interface LogInterface extends Iterator, Countable, ArrayAccess, JsonSerializable
{
/**
* Get the default parser
*
* @return ParserInterface
*/
public static function getDefaultParser(): ParserInterface;
/**
* Set the log file
*
* @param LogFileInterface $logFile
* @return $this
*/
public function setLogFile(LogFileInterface $logFile): static;
/**
* Get the log file
*
* @return LogFileInterface
*/
public function getLogFile(): LogFileInterface;
/**
* Get a human-readable title for the log
*
* @return string
*/
public function getTitle(): string;
/**
* Parse a log file with a parser
*
* Every log type should have a default parser,
* but the $parser argument can be used to override
* the default parser
*
* @param ParserInterface|null $parser
* @return $this
*/
public function parse(?ParserInterface $parser = null): static;
/**
* Set all entries of the log at once replacing the current entries
*
* @param EntryInterface[] $entries
* @return $this
*/
public function setEntries(array $entries = []): static;
/**
* Add an entry to the log
*
* @param EntryInterface $entry
* @return $this
*/
public function addEntry(EntryInterface $entry): static;
/**
* Get all entries of the log
*
* @return EntryInterface[]
*/
public function getEntries(): array;
/**
* @return string
*/
public function __toString(): string;
/**
* Return the current element
*
* @return EntryInterface
*/
public function current(): EntryInterface;
/**
* Offset to set
*
* @param mixed $offset
* @param EntryInterface $value
*/
public function offsetSet(mixed $offset, mixed $value): void;
/**
* Offset to retrieve
*
* @param mixed $offset
* @return EntryInterface
*/
public function offsetGet(mixed $offset): EntryInterface;
}