CoreFiles by mySites.guru
Canary.php39 lines, 735 bytes, from Joomla_6.0.3-Stable-Full_Package.zip
Raw History Compare with 6.0.2
md5
f21010ce2298464d5e4c61a6856b0969
sha1
813140b8b7e86bc60fa519711340dd5f010056a5
sha256
f191b1ceb73b1635671543fd8b542a9058343579a39ef97fff75e3aef02090fd
<?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\HttpClient\Internal;

/**
 * @author Nicolas Grekas <[email protected]>
 *
 * @internal
 */
final class Canary
{
    public function __construct(
        private \Closure $canceller,
    ) {
    }

    public function cancel(): void
    {
        if (isset($this->canceller)) {
            $canceller = $this->canceller;
            unset($this->canceller);
            $canceller();
        }
    }

    public function __destruct()
    {
        $this->cancel();
    }
}

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