aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/symfony/form/Symfony/Component/Form/FormTypeGuesserInterface.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/symfony/form/Symfony/Component/Form/FormTypeGuesserInterface.php')
-rw-r--r--vendor/symfony/form/Symfony/Component/Form/FormTypeGuesserInterface.php64
1 files changed, 64 insertions, 0 deletions
diff --git a/vendor/symfony/form/Symfony/Component/Form/FormTypeGuesserInterface.php b/vendor/symfony/form/Symfony/Component/Form/FormTypeGuesserInterface.php
new file mode 100644
index 00000000..e8b603fa
--- /dev/null
+++ b/vendor/symfony/form/Symfony/Component/Form/FormTypeGuesserInterface.php
@@ -0,0 +1,64 @@
1<?php
2
3/*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12namespace Symfony\Component\Form;
13
14/**
15 * @author Bernhard Schussek <bschussek@gmail.com>
16 */
17interface FormTypeGuesserInterface
18{
19 /**
20 * Returns a field guess for a property name of a class
21 *
22 * @param string $class The fully qualified class name
23 * @param string $property The name of the property to guess for
24 *
25 * @return Guess\TypeGuess A guess for the field's type and options
26 */
27 public function guessType($class, $property);
28
29 /**
30 * Returns a guess whether a property of a class is required
31 *
32 * @param string $class The fully qualified class name
33 * @param string $property The name of the property to guess for
34 *
35 * @return Guess\Guess A guess for the field's required setting
36 */
37 public function guessRequired($class, $property);
38
39 /**
40 * Returns a guess about the field's maximum length
41 *
42 * @param string $class The fully qualified class name
43 * @param string $property The name of the property to guess for
44 *
45 * @return Guess\Guess A guess for the field's maximum length
46 */
47 public function guessMaxLength($class, $property);
48
49 /**
50 * Returns a guess about the field's pattern
51 *
52 * - When you have a min value, you guess a min length of this min (LOW_CONFIDENCE) , lines below
53 * - If this value is a float type, this is wrong so you guess null with MEDIUM_CONFIDENCE to override the previous guess.
54 * Example:
55 * You want a float greater than 5, 4.512313 is not valid but length(4.512314) > length(5)
56 * @link https://github.com/symfony/symfony/pull/3927
57 *
58 * @param string $class The fully qualified class name
59 * @param string $property The name of the property to guess for
60 *
61 * @return Guess\Guess A guess for the field's required pattern
62 */
63 public function guessPattern($class, $property);
64}