-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add compatibility with symfony 2.8 and 3.0 for choice type field
- Loading branch information
Showing
2 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace Anacona16\Bundle\ImageCropBundle\Util; | ||
|
||
use Symfony\Component\HttpKernel\Kernel; | ||
|
||
final class LegacyFormHelper | ||
{ | ||
const MINIMUM_MAJOR_VERSION = 3; | ||
|
||
/** | ||
* Check whether to use legacy form behaviour from Symfony <3.0. | ||
* | ||
* @param int $majorVersion Major version | ||
* | ||
* @static | ||
* | ||
* @return bool | ||
*/ | ||
public static function isLegacy($majorVersion = Kernel::MAJOR_VERSION) | ||
{ | ||
return $majorVersion < self::MINIMUM_MAJOR_VERSION; | ||
} | ||
} |