# tidy->repairString and repairFile

- Thread: https://externals.io/message/10893
- Original archive: https://news-web.php.net/php.internals/10893
- Started by Nuno Lopes on 2004-07-04T10:10:49+00:00
- Messages: 4
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #10893 — Nuno Lopes — 2004-07-04T10:10:49+00:00

URL: https://externals.io/message/10893#10893

Hello,

Today I was finishing writing the tidy docs and I've noted that the
functions $tidy->repairString() and $tidy->repairFile() simply don't work!
And I think these functions should be removed. I'll explain:

non-OO way:
<?
echo tidy_repair_string($html);
?>

OO way:
<?
$tidy = new tidy;
var_dump($tidy->repairString($html));
echo $html;

?>

The non-OO way is very simple, you give it a broken HTML and it returns a
repaired HTML string. And in OO? It returns nothing! And why should you want
that function in OO? tidy_repair_string() is a one-time use only function.
Even if it exists in OO, you can't do anything with it (even if it
worked...)

Can you delete those funtions, please (isn't really the functions, just the
OO mapping)?

Thanks,
Nuno

---

## #10895 — Nuno Lopes — 2004-07-04T14:15:01+00:00

URL: https://externals.io/message/10893#10895 · In reply to: #10894

> Maybe John has to make this methods static and they will work just like
the
> functions.
>
> Regards,
> Andrey


Thats a good idea! But as we already have the non-OO function, I don't know
if it worth to create the static methods.
Nuno

---

## #10894 — Andrey Hristov — 2004-07-04T15:40:48+00:00

URL: https://externals.io/message/10893#10894 · In reply to: #10893

Nuno Lopes wrote:
> Hello,
> 
> Today I was finishing writing the tidy docs and I've noted that the
> functions $tidy->repairString() and $tidy->repairFile() simply don't work!
> And I think these functions should be removed. I'll explain:
> 
> non-OO way:
> <?
> echo tidy_repair_string($html);
> ?>
> 
> OO way:
> <?
> $tidy = new tidy;
> var_dump($tidy->repairString($html));
> echo $html;
> 
> ?>
> 
> The non-OO way is very simple, you give it a broken HTML and it returns a
> repaired HTML string. And in OO? It returns nothing! And why should you want
> that function in OO? tidy_repair_string() is a one-time use only function.
> Even if it exists in OO, you can't do anything with it (even if it
> worked...)
> 
> Can you delete those funtions, please (isn't really the functions, just the
> OO mapping)?
> 
> Thanks,
> Nuno
> 
Maybe John has to make this methods static and they will work just like the
functions.

Regards,
Andrey

---

## #10896 — Andrey Hristov — 2004-07-04T17:50:39+00:00

URL: https://externals.io/message/10893#10896 · In reply to: #10895

Quoting Nuno Lopes <nlopess@php.net>:

> > […]
> the
> > […]
>
>
> Thats a good idea! But as we already have the non-OO function, I don't know
> if it worth to create the static methods.
> Nuno
>
For the purists out there :)

andrey
