<commit_before><?php

namespace WP_CLI_Dotenv\Dotenv;

use Illuminate\Support\Collection;

class FileLines extends Collection
{
    /**
     * Create a new collection of file lines from the file at given path
     * @param  [type] $filepath [description]
     * @return [type]           [description]
     */
    public static function load($filepath)
    {
        return (new static(file($filepath, FILE_IGNORE_NEW_LINES)))
            ->map(function ($lineText) {
                return new Line($lineText);
            });
    }

    /**
     * @return string
     */
    public function toString()
    {
        return $this->map(function ($line) {
            return $line->toString();
        })->implode(PHP_EOL);
    }

    /**
     * Return a new collection of only key value line pairs
     *
     * @return static
     */
    public function pairs()
    {<commit_msg>update FileLines to use Line::parse_raw() on load<commit_after><?php

namespace WP_CLI_Dotenv\Dotenv;

use Illuminate\Support\Collection;

class FileLines extends Collection
{
    /**
     * Create a new collection of file lines from the file at given path.
     *
     * @param $filePath
     *
     * @return static
     */
    public static function load($filePath)
    {
        return static::make(file($filePath, FILE_IGNORE_NEW_LINES))
            ->map(function ($lineText) {
                return Line::parse_raw($lineText);
            });
    }

    /**
     * @return string
     */
    public function toString()
    {
        return $this->map(function ($line) {
            return $line->toString();
        })->implode(PHP_EOL);
    }

    /**
     * Return a new collection of only key value line pairs
     *
     * @return static
     */
    public function pairs()
    {
{'fraction_non_alphanumeric': 0.11468926553672316, 'fraction_numerical': 0.0, 'mean_word_length': 2.053448275862069, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2193824', 'n_tokens_mistral': 508, 'n_tokens_neox': 507, 'n_words': 137}