mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
N°8772 - Form dependencies manager implementation
- Form SDK implementation - Basic Forms - Dynamics Forms - Basic Blocks + Data Model Block - Form Compilation - Turbo integration
This commit is contained in:
32
lib/symfony/validator/Validator/LazyProperty.php
Normal file
32
lib/symfony/validator/Validator/LazyProperty.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Validator\Validator;
|
||||
|
||||
/**
|
||||
* A wrapper for a callable initializing a property from a getter.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class LazyProperty
|
||||
{
|
||||
private \Closure $propertyValueCallback;
|
||||
|
||||
public function __construct(\Closure $propertyValueCallback)
|
||||
{
|
||||
$this->propertyValueCallback = $propertyValueCallback;
|
||||
}
|
||||
|
||||
public function getPropertyValue(): mixed
|
||||
{
|
||||
return ($this->propertyValueCallback)();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user