Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ composer.lock
vendor
.phpunit.cache
.phpcs.cache
dist
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ AWDY
### Composer (preferred)

```bash
composer require robertwesner/awdy "*"
composer require robertwesner/awdy
```

### Single file download

1) Download [/dist/AWDY.php](../../raw/main/dist/AWDY.php).
1) Download [/dist/AWDY.php](https://github.com/RobertWesner/awdy/releases/latest/download/AWDY.php).
2) Include the bundled file in your script:
```php
require __DIR__ . '/AWDY.php';
Expand All @@ -41,7 +41,7 @@ If you wish to not use composer or manually download a file, you can add followi

```php
$awdyPath = tempnam(sys_get_temp_dir(), 'awdy_');
file_put_contents($awdyPath, fopen('https://raw.githubusercontent.com/RobertWesner/awdy/main/dist/AWDY.php', 'r'));
file_put_contents($awdyPath, fopen('https://github.com/RobertWesner/awdy/releases/latest/download/AWDY.php', 'r'));
require $awdyPath;
```

Expand Down
4 changes: 2 additions & 2 deletions src/AWDY.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ public static function setUp(TemplateInterface $template, ?int $width = null, ?i
/**
* Print to the Template.
*/
public static function echo(string $echo): void
public static function echo(string ...$echo): void
{
self::$template->handleEcho($echo);
self::$template->handleEcho(implode('', $echo));
self::render();
}

Expand Down
40 changes: 40 additions & 0 deletions tests/AWDYTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,46 @@ public function test(): void
self::assertSame(<<<EOF

100/100 [==========================================]
EOF, $this->renderAwdyOutput(ob_get_clean()));

ob_start();
AWDY::echo('!', PHP_EOL);
self::assertSame(<<<EOF

test!













EOF, $this->renderAwdyOutput(ob_get_clean()));

ob_start();
AWDY::printf('A number: %d' . PHP_EOL, 1337);
self::assertSame(<<<EOF

test!
A number: 1337












EOF, $this->renderAwdyOutput(ob_get_clean()));
}
}