vendor/gasparesganga/php-shapefile/src/Shapefile/ShapefileException.php line 18

Open in your IDE?
  1. <?php
  2. /**
  3.  * PHP Shapefile - PHP library to read and write ESRI Shapefiles, compatible with WKT and GeoJSON
  4.  *
  5.  * @package Shapefile
  6.  * @author  Gaspare Sganga
  7.  * @version 3.4.0
  8.  * @license MIT
  9.  * @link    https://gasparesganga.com/labs/php-shapefile/
  10.  */
  11. namespace Shapefile;
  12. /**
  13.  * Exception thrown by this library.
  14.  */
  15. class ShapefileException extends \Exception
  16. {
  17.     /**
  18.      * @var string      Error type that raised the exception.
  19.      */
  20.     private $error_type;
  21.     
  22.     /**
  23.      * @var string      Additional information about the error.
  24.      */
  25.     private $details;
  26.     
  27.     
  28.     /**
  29.      * Constructor
  30.      *
  31.      * @param   string  $error_type     Error type.
  32.      * @param   string  $details        Optional information about the error.
  33.      */
  34.     public function __construct($error_type$details '')
  35.     {
  36.         $this->error_type   $error_type;
  37.         $this->details      $details;
  38.         
  39.         $message constant('Shapefile\Shapefile::' $error_type '_MESSAGE');
  40.         parent::__construct($message0null);
  41.     }
  42.     
  43.     /**
  44.      * Gets internal error type.
  45.      *
  46.      * @return  string
  47.      */
  48.     public function getErrorType()
  49.     {
  50.         return $this->error_type;
  51.     }
  52.     
  53.     /**
  54.      * Gets error details.
  55.      *
  56.      * @return  string
  57.      */
  58.     public function getDetails()
  59.     {
  60.         return $this->details;
  61.     }
  62. }