CoreFiles by mySites.guru
LazyProperty.php32 lines, 696 bytes, from Joomla_5.2.6-Stable-Full_Package.zip
Raw History Compare with 5.2.5
md5
3085665b5b5a60edd0194869f21e1a6b
sha1
f45baa7699c560944ebb8a66a871be3fd0248c8b
sha256
312652320071ab82d6c7592f6acb653872c78c5dfd417d301ee726624abb2030
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <[email protected]>
 *
 * 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)();
    }
}

The same content is in 136 releases, Joomla 5.1.0-beta1 to 6.3.0-alpha1. See them all, or every version of this file.