fork download
  1. <?php
  2.  
  3. public function someController1($id)
  4. {
  5. private $fileGateway;
  6.  
  7. $file = $this->fileGateway->getFile($id);
  8. if (!isset($file)) {
  9. throw new notFoundException();
  10. }
  11. }
  12.  
  13. public function someController2($id)
  14. {
  15. private $fileGateway;
  16.  
  17. try {
  18. $file = $this->fileGateway->getFile($id);
  19. } catch (Exception $e) {
  20. throw new notFoundException();
  21. }
  22. }
  23.  
  24. public function someFileGateway1()
  25. {
  26. public function getFile($id) {
  27. if (!$this->isFileExist($id)) {
  28. return null;
  29. }
  30. }
  31. }
  32.  
  33. public function someFileGateway2()
  34. {
  35. public function getFile($id) {
  36. if (!$this->isFileExist($id)) {
  37. throw new Exception();
  38. }
  39. }
  40. }
  41.  
Runtime error #stdin #stdout #stderr 0.01s 82880KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Parse error:  syntax error, unexpected 'public' (T_PUBLIC), expecting end of file in /home/0T7tBI/prog.php on line 3