spekulatius / PHPScraper

A universal web-util for PHP.
https://phpscraper.de
GNU General Public License v3.0
533 stars 75 forks source link

charset in headers method #81

Closed tacman closed 2 years ago

tacman commented 2 years ago

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 commented 2 years ago

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

tacman commented 2 years ago

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

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

spekulatius commented 2 years ago

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