Added initial codebase

This commit is contained in:
netkas 2025-01-22 01:02:17 -05:00
parent 493a86bc9b
commit 80a6af74ed
41 changed files with 5676 additions and 29 deletions

View file

@ -0,0 +1,39 @@
<?php
class ExampleClass {
private \LogLib2\Logger $logger;
public function __construct(\LogLib2\Logger $logger) {
$this->logger = $logger;
}
public function getLogger(): \LogLib2\Logger {
return $this->logger;
}
public function sleepExample(int $seconds): void {
$this->logger->info("Sleeping for $seconds seconds...");
sleep($seconds);
$this->logger->info("Finished sleeping for $seconds seconds.");
}
public function throwException(): void {
throw new \Exception("This is an example exception.");
}
public function throwDoubleException(): void {
try
{
$this->throwException();
}
catch(Exception $e)
{
throw new Exception("this is a new exception", 0, $e);
}
}
public function warningExceptionExample(): void {
$this->logger->warning("Throwing a warning exception...", new \Exception("This is an example warning exception."));
}
}