From 6d8fb621d1e93b83786890d6d9cb6f0d8defa8ae Mon Sep 17 00:00:00 2001 From: DJ O'Leary Date: Fri, 26 Jun 2026 18:04:09 +0200 Subject: refactor!: invert repo directory structure now is language first --- php/2024/day_04/Input.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 php/2024/day_04/Input.php (limited to 'php/2024/day_04/Input.php') diff --git a/php/2024/day_04/Input.php b/php/2024/day_04/Input.php new file mode 100644 index 0000000..60a16a0 --- /dev/null +++ b/php/2024/day_04/Input.php @@ -0,0 +1,25 @@ +fileName, use_include_path: true); + $this->contents = $contents === false ? "" : $contents; + } + + public function toGrid(): Grid + { + $lines = explode("\n", $this->contents); + $gridArray = array_map( + callback: fn (string $line): array => str_split(trim($line)), + array: $lines + ); + + return new Grid($gridArray); + } +} -- cgit v1.2.3