为什么我需要在我的存储库中扩展 ServiceEntityRepository?在 Symfony 3.4 中,我总是扩展 EntityRepository。使用 ServiceEntityRepository 我在这里描述了一个奇怪的问题Symfony 4. InheritanceType("JOINED") 和 ParamConverter。奇怪的现象
我有公开服务的解决方案。在 services.yml
test_phpdocxService:
alias: App\Service\PhpDocxService
public: true
Run Code Online (Sandbox Code Playgroud)
我尝试访问该服务:
$container = self::$container;
$phpDocxService = $container->get('test_phpdocxService');
$this->filename = $phpDocxService->generateDocxDocument('docx/aaa.html.twig', $data);
Run Code Online (Sandbox Code Playgroud)
但我觉得它不是那么好。有没有另一种方法可以做到这一点?
是否可以将最新版本的 PHPUnit (7.0.1) 与 Symfony 3.4 一起使用?我收到错误
PHP 致命错误: Symfony\Bridge\PhpUnit\CoverageListener::startTest(PHPUnit\Framework\Test $test) 的声明必须与 PHPUnit\Framework\TestListener::startTest(PHPUnit\Framework\Test $test) 兼容: void in / var/www/vhosts/facto/vendor/symfony/phpunit-bridge/CoverageListener.php 第 30 行
我的 phpunit-bridge 与最新版本的 PHPUnit 不兼容。
我正在使用 Symfony 的登录表单,但如果输入的用户名是“FOO”并且数据库中存储的是“foo”,则我无法登录。我正在使用 Postgres。这意味着用户名字段区分大小写。我能做些什么?