PHPScraper icon indicating copy to clipboard operation
PHPScraper copied to clipboard

charset in headers method

Open tacman opened this issue 3 years ago • 2 comments

Is this method used? Where is charset() defined?

    /**
     * Get the header collected as an array
     *
     * @return array
     */
    public function headers()
    {
        return [
            'charset' => $this->charset(),
            'contentType' => $this->contentType(),
            'viewport' => $this->viewport(),
            'canonical' => $this->canonical(),
            'csrfToken' => $this->csrfToken(),
        ];
    }

tacman avatar Jul 15 '22 13:07 tacman

Oh, I see, it's a magic method. Can we explicitly define it?

tacman avatar Jul 15 '22 13:07 tacman

Brainstorming -- what do you think of removing the magic methods and simply calling the methods directly?

That is, $web->links() instead of $web->links

tacman avatar Jul 15 '22 14:07 tacman

As mentioned in the other ticket, I like my magic methods ;)

spekulatius avatar Aug 11 '22 08:08 spekulatius