1; } /** * Get all pairs of adjacent characters within the line. * * @param string $line * * @return bool */ private static function getCharPairs($line) { $chars = str_split($line); return array_map(null, $chars, array_slice($chars, 1)); } /** * Determine if the line in the file is a comment or whitespace. * * @param string $line * * @return bool */ private static function isCommentOrWhitespace($line) { if (trim($line) === '') { return true; } $line = ltrim($line); return isset($line[0]) && $line[0] === '#'; } }