65536) { throw new LengthException('CSV exceeds the example input limit'); } $result = $this->processes->input($csv)->timeout(1) ->run([PHP_BINARY, $this->validator])->throw(); $data = json_decode($result->output(), true, flags: JSON_THROW_ON_ERROR); if (!is_array($data) || array_keys($data) !== ['rows'] || !is_int($data['rows']) || $data['rows'] < 0) { throw new UnexpectedValueException('Invalid validator response'); } return $data['rows']; } }