Update "tools" directory to be compliant with the php-cs-fixer

This commit is contained in:
2023-04-13 21:53:13 +02:00
parent ba83207264
commit e719b3e11c
5 changed files with 791 additions and 715 deletions

View File

@@ -1,26 +1,29 @@
#!/usr/bin/php
<?php
require_once (__DIR__."/../src/markdown.php");
require_once(__DIR__ . "/../src/markdown.php");
if (! isset ($argv[1]))
{
file_put_contents ("php://stderr",
"No file to convert in markdown provided\n");
exit (1);
if (! isset($argv[1])) {
file_put_contents(
"php://stderr",
"No file to convert in markdown provided\n"
);
exit(1);
}
if (! file_exists ($argv[1]))
{
file_put_contents ("php://stderr",
"The file to convert in markdown doesn't exists\n");
exit (2);
if (! file_exists($argv[1])) {
file_put_contents(
"php://stderr",
"The file to convert in markdown doesn't exists\n"
);
exit(2);
}
if (! is_readable ($argv[1]))
{
file_put_contents ("php://stderr",
"The file to convert in markdown is not readable\n");
exit (3);
if (! is_readable($argv[1])) {
file_put_contents(
"php://stderr",
"The file to convert in markdown is not readable\n"
);
exit(3);
}
$md = new markdown ();
echo $md->html (file_get_contents ($argv[1]));
$md = new Domframework\Markdown();
echo $md->html(file_get_contents($argv[1]));