From c223ab602cbe7f6db7321ba547164971d63d7bcd Mon Sep 17 00:00:00 2001 From: Fbenas Date: Sun, 29 Apr 2018 22:24:25 +0100 Subject: WIP --- src/File/Handler.php | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/File/Handler.php (limited to 'src/File/Handler.php') diff --git a/src/File/Handler.php b/src/File/Handler.php new file mode 100644 index 0000000..61c78a8 --- /dev/null +++ b/src/File/Handler.php @@ -0,0 +1,56 @@ + + * @param string $filename [description] + */ + public function __construct(string $filename) + { + $this->filename = $filename; + if (!is_readable($filename)) { + throw new Exception('Cannot read from file: ' . $filename); + } + $this->load; + } + + /** + * Load the file + * + * @author Phil Burton + */ + public function load() + { + $this->file = file_get_contents($this->filename); + } + + /** + * Parse file and return array + * + * @author Phil Burton + * @return array + */ + public function getVendorArray(): array + { + if (!$this->array) { + $this->array = []; + } + + return $this->array; + } +} -- cgit v1.2.3