• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

heimrichhannot / contao-utils-bundle / 8111841604

01 Mar 2024 01:05PM UTC coverage: 72.668% (+0.09%) from 72.575%
8111841604

push

github

koertho
fix test

779 of 1072 relevant lines covered (72.67%)

3.5 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

14.29
/src/EventListener/DcaField/AbstractDcaFieldListener.php
1
<?php
2

3
namespace HeimrichHannot\UtilsBundle\EventListener\DcaField;
4

5
use Contao\CoreBundle\Framework\ContaoFramework;
6
use Contao\Model;
7
use Psr\Container\ContainerInterface;
8
use Symfony\Contracts\Service\ServiceSubscriberInterface;
9

10
abstract class AbstractDcaFieldListener implements ServiceSubscriberInterface
11
{
12
    public function __construct(protected ContainerInterface $container)
13
    {
14
    }
3✔
15

16
    protected function getModelInstance(string $table, int $id): ?Model
17
    {
18
        $framework = $this->container->get('contao.framework');
×
19
        $modelClass = $framework->getAdapter(Model::class)->getClassFromTable($table);
×
20
        return $framework->getAdapter($modelClass)->findByPk($id);
×
21
    }
22

23
    public static function getSubscribedServices(): array
24
    {
25
        return [
×
26
            'contao.framework' => ContaoFramework::class,
×
27
        ];
×
28
    }
29
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc