Пример #1
0
 /**
  * Constructs a new `FileInfo` instance.
  *
  * @param string $file Path to file.
  */
 public function __construct($file)
 {
     if (!is_string($file)) {
         throw new InvalidArgumentException('FileInfo expects a string.');
     }
     // cache loaded media types
     if (self::$mediaTypes === null) {
         self::$mediaTypes = $this->loadMediaTypes();
     }
     $this->file = $file;
 }