Skip to content

Commit 0c03c85

Browse files
fixed some deprecations
1 parent 9834c3a commit 0c03c85

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Form/DoctrineOrmTypeGuesser.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,19 @@ class DoctrineOrmTypeGuesser extends BaseDoctrineOrmTypeGuesser
1919
public function guessType($class, $property)
2020
{
2121
if (!$ret = $this->getMetadata($class)) {
22-
return new TypeGuess('text', [], Guess::LOW_CONFIDENCE);
22+
$type = method_exists('Symfony\Component\Form\AbstractType', 'getBlockPrefix')
23+
? 'Symfony\Component\Form\Extension\Core\Type\TextType'
24+
: 'text';
25+
return new TypeGuess($type, [], Guess::LOW_CONFIDENCE);
2326
}
2427

2528
$metadata = $ret[0];
2629

2730
if ('simple_array' == $metadata->getTypeOfField($property)) {
28-
return new TypeGuess('simple_array', [], Guess::MEDIUM_CONFIDENCE);
31+
$type = method_exists('Symfony\Component\Form\AbstractType', 'getBlockPrefix')
32+
? 'EmanueleMinotto\SimpleArrayBundle\Form\Type\SimpleArrayType'
33+
: 'simple_array';
34+
return new TypeGuess($type, [], Guess::MEDIUM_CONFIDENCE);
2935
}
3036

3137
return parent::guessType($class, $property);

Form/Type/SimpleArrayType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
3535
*/
3636
public function getParent()
3737
{
38-
return method_exists(__CLASS__, 'getBlockPrefix')
38+
return method_exists('Symfony\Component\Form\AbstractType', 'getBlockPrefix')
3939
? 'Symfony\Component\Form\Extension\Core\Type\TextType'
4040
: 'text';
4141
}

0 commit comments

Comments
 (0)