Implement a minimal PHP log parser under /app/ that supports parsing the request time token (%T) from a single-format line and returns an entry object containing the parsed value.
Requirements:
Create a FormatException class:
File: /app/Kassner/LogParser/FormatException.php
Namespace: Kassner\LogParser
Class: FormatException (extends \Exception)
Create a LogEntry class to hold parsed data:
File: /app/Kassner/LogParser/LogEntry.php
Namespace: Kassner\LogParser
Class: LogEntry
Public property: public $requestTime
Create a LogParser class that supports a very small, single-format capability:
File: /app/Kassner/LogParser/LogParser.php
Namespace: Kassner\LogParser
Class: LogParser
Methods:
public function setFormat($format)
Accepts a format string. For this task, the only supported format is '%T'.
Store the format for use by parse().
public function parse($line)
Behavior when format is '%T':
Validate that $line is a non-null string containing only digits with an optional decimal point and digits after it.