krak / symfony-playground
Symfony playground for tinkering/testign your app.
Installs: 11 688
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 1
Type:symfony-bundle
Requires (Dev)
- nyholm/symfony-bundle-test: ^1.6
- phpunit/phpunit: ^9.1
- symfony/dependency-injection: ^4.4
- symfony/http-kernel: ^4.4
- symfony/var-dumper: ^5.1
This package is auto-updated.
Last update: 2024-11-13 17:20:55 UTC
README
Symfony playground enables developers to quickly test any code in their system and access any of the private services in their app.
Installation
Install with composer at krak/symfony-playground
.
Then you need to change the PlaygroundBundle in your config/bundles.php
file to be dev only:
return [ // ... Krak\SymfonyPlayground\PlaygroundBundle::class => ['dev' => true], ];
Usage
To enable the playground, you can create a playground.php in the project root: %kernel.project_dir%/playground.php
.
This file needs to return a closure. Here's an example:
<?php /** this function is autowired, so type hint any service to access it here */ return function(App\Service\MyService $service, Psr\Log\LoggerInterface $log) { $log->info("Playing with my symfony app!"); };
You should be able to run this with: ./bin/console playground
.