__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
/**
* Joomla! Content Management System
*
* @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Event\Result;
// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
/**
* This Trait partially implements the ResultAwareInterface for type checking.
*
* Events using this Trait (and the ResultAware trait) will expect event handlers to set results
* of a Float type.
*
* @since 4.2.0
*/
trait ResultTypeFloatAware
{
/**
* Can the result attribute values also be NULL?
*
* @var boolean
* @since 4.2.0
*/
protected $resultIsNullable = false;
/**
* Can the result attribute values also be boolean FALSE?
*
* @var boolean
* @since 4.2.0
*
* @deprecated 4.3 will be removed in 7.0
* You should use nullable values or exceptions instead of returning boolean false results.
*/
protected $resultIsFalseable = false;
/**
* Checks the type of the data being appended to the result argument.
*
* @param mixed $data The data to type check
*
* @return void
* @throws \InvalidArgumentException
*
* @internal
* @since 4.2.0
*/
public function typeCheckResult($data): void
{
if ($this->resultIsNullable && $data === null) {
return;
}
if ($this->resultIsFalseable && $data === false) {
return;
}
if (!\is_float($data)) {
throw new \InvalidArgumentException(\sprintf('Event %s only accepts Float results.', $this->getName()));
}
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| ResultAware.php | File | 4.65 KB | 0664 |
|
| ResultAwareInterface.php | File | 1.56 KB | 0664 |
|
| ResultTypeArrayAware.php | File | 1.74 KB | 0664 |
|
| ResultTypeBooleanAware.php | File | 1.32 KB | 0664 |
|
| ResultTypeFloatAware.php | File | 1.73 KB | 0664 |
|
| ResultTypeIntegerAware.php | File | 1.74 KB | 0664 |
|
| ResultTypeMixedAware.php | File | 1.14 KB | 0664 |
|
| ResultTypeNumericAware.php | File | 1.74 KB | 0664 |
|
| ResultTypeObjectAware.php | File | 2.51 KB | 0664 |
|
| ResultTypeStringAware.php | File | 1.74 KB | 0664 |
|