public function isolatePHP(string $source): string
    {
        $phpBlock = false;

        $isolated = '';
        foreach (token_get_all($source) as $token) {
            if ($this->isOpenTag($token)) {
                $phpBlock = $token[1];

                continue;
            }

            if ($this->isCloseTag($token)) {
                $blockID = $this->uniqueID();

                $this->phpBlocks[$blockID] = $phpBlock . $token[1];
                $isolated .= $this->placeholder($blockID);

                $phpBlock = '';

                continue;
            }

            $tokenContent = is_array($token) ? $token[1] : $token;

            if (!empty($phpBlock)) {
                $phpBlock .= $tokenContent;
            } else {
                $isolated .= $tokenContent;
            }
        }

        return $isolated;
    }