Lines
100.00%
7 / 7
Functions and Methods
100.00%
1 / 1
Classes and Traits
100.00%
1 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| AgentStatImportType | 100.00% | 7 / 7 | 100.00% | 1 / 1 | 1 | 100.00% | 1 / 1 | |||
| buildForm | 100.00% | 7 / 7 | 100.00% | 1 / 1 | 1 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace App\Form; | |
| 6 | ||
| 7 | use Symfony\Component\Form\AbstractType; | |
| 8 | use Symfony\Component\Form\Extension\Core\Type\TextareaType; | |
| 9 | use Symfony\Component\Form\FormBuilderInterface; | |
| 10 | use Symfony\Component\Validator\Constraints\NotBlank; | |
| 11 | ||
| 12 | /** | |
| 13 | * Ingress all-time stats pasted as copied from the game. | |
| 14 | */ | |
| 15 | final class AgentStatImportType extends AbstractType | |
| 16 | { | |
| 17 | #[\Override] | |
| 18 | public function buildForm(FormBuilderInterface $builder, array $options): void | |
| 19 | { | |
| 20 | $builder->add('stats', TextareaType::class, [ | |
| 21 | 'label' => 'Ingress stats', | |
| 22 | 'help' => 'In Ingress: Agent profile → All time → copy the stats, then paste them here.', | |
| 23 | 'constraints' => [new NotBlank()], | |
| 24 | // Keep the tabs: the stats are tab-separated | |
| 25 | 'trim' => false, | |
| 26 | 'attr' => ['rows' => 6, 'class' => 'font-monospace'], | |
| 27 | ]); | |
| 28 | } | |
| 29 | } |