Advertisement
roman_gemini

incapsulation

Mar 9th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.33 KB | None | 0 0
  1. <?php
  2.  
  3. class FileSystem {
  4.     public function store($file)
  5.     {
  6.         $this->checkFreeSpace();
  7.         $this->storeFile($file);
  8.     }
  9.     private function checkFreeSpace()
  10.     {
  11.         if (free_disk_space() == 0) {
  12.             throw new Exception("Not enought free space.");
  13.         }
  14.     }
  15.     private function storeFile($file)
  16.     {
  17.         // Real code for store file
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement