Skip to content

Instantly share code, notes, and snippets.

@infinitypaul
Created August 22, 2019 16:41
Show Gist options
  • Save infinitypaul/5a4ab46b4aac27cac9a3665b14e76f84 to your computer and use it in GitHub Desktop.
Save infinitypaul/5a4ab46b4aac27cac9a3665b14e76f84 to your computer and use it in GitHub Desktop.
<?php
class User {
/**
* @var \Logger
*/
public $logger;
public function __construct(Logger $logger)
{
$this->logger = $logger;
}
public function create($data){
try {
//Save User To Database
} catch (Exception $exception){
$this->logger->writeToFile($exception->getMessage());
}
}
public function edit(){
//Edit User Record
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment