Skip to content

Commit b527ae0

Browse files
committed
refactor(debug): remove unused helper and commented logic in DebugBarOutput
- Removed the `base64_encode_file` helper function from `helpers.php` as it is unused. - Removed the corresponding test case for `base64_encode_file` in `HelpersTest.php`. - Commented out the `isEnabled` method call in `DebugBarOutput::isAvailable`, likely for debugging or evaluation purposes. - These changes simplify the codebase by removing unused functionality and modifying logic handling debug output.
1 parent 8335c56 commit b527ae0

File tree

3 files changed

+1
-13
lines changed

3 files changed

+1
-13
lines changed

src/Outputs/DebugBarOutput.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function shouldOutput(CommandFinished|Response $outputter): bool
3333
{
3434
return class_exists(LaravelDebugbar::class)
3535
&& app()->has(LaravelDebugbar::class)
36-
&& resolve(LaravelDebugbar::class)->isEnabled()
36+
// && resolve(LaravelDebugbar::class)->isEnabled()
3737
&& $this->isHtmlResponse($outputter);
3838
}
3939

src/Support/helpers.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,6 @@
1919
use Illuminate\Support\Arr;
2020
use Illuminate\Support\Collection;
2121

22-
if (!\function_exists('Guanguans\LaravelSoar\Support\base64_encode_file')) {
23-
function base64_encode_file(string $filename): string
24-
{
25-
return base64_encode(file_get_contents($filename));
26-
}
27-
}
28-
2922
if (!\function_exists('Guanguans\LaravelSoar\Support\classes')) {
3023
/**
3124
* @see https://github.com/alekitto/class-finder

tests/Support/HelpersTest.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,12 @@
1818
* @see https://github.com/guanguans/laravel-soar
1919
*/
2020

21-
use function Guanguans\LaravelSoar\Support\base64_encode_file;
2221
use function Guanguans\LaravelSoar\Support\env_explode;
2322
use function Guanguans\LaravelSoar\Support\humanly_milliseconds;
2423
use function Guanguans\LaravelSoar\Support\json_pretty_encode;
2524
use function Guanguans\LaravelSoar\Support\make;
2625
use function Guanguans\LaravelSoar\Support\star_for;
2726

28-
it('can base64 encode file for `base64_encode_file`', function (): void {
29-
expect(base64_decode(base64_encode_file(__FILE__), true))->toBe(file_get_contents(__FILE__));
30-
})->group(__DIR__, __FILE__);
31-
3227
it('can humanly milliseconds', function (): void {
3328
expect([
3429
humanly_milliseconds(0.1),

0 commit comments

Comments
 (0)