*/ interface csv { /** * File * * Path directories to the file will not be created automatically to avoid * checking the existence of all directories on every read or write operation. * * @var string FILE Path to the database file */ public const string FILE = 'database.csv'; /** * Write * * Write to the database file * * @return void */ public static function write(): void; /** * Read * * Read from the start of the database file * * @param int $rows Amount of rows for reading * * @return array|null Readed records */ public static function read(int $rows = 1): ?array; /** * Last * * Read from the end of the database file * * @param int $rows Amount of rows for reading * * @return array|null Readed records */ public static function last(int $rows = 1): ?array; /** * Serialize * * Preparing data for writing to the database * * @param array $parameters Values for serializing * * @return string|false Serialized data */ public static function serialize(array $parameters): string|false; /** * Deserialize * * Preparing data from the database to processing * * @param string $row Record for deserializing * * @return array|false Serialized data */ public static function deserialize(string $row): array|false; }