CoreFiles by mySites.guru
ResultTypeMixedAware.php44 lines, 1,199 bytes, from Joomla_4.2.2-Stable-Full_Package.zip
Raw History Compare with 4.2.1
md5
2425a24e9513a30c302f3f114ffcfcc9
sha1
f02bb6462108ba672a7438d6f18eb2e10b1d13d8
sha256
8773ee9fcadca4518b8aac95690ec2f1ab10802d4699120276a256ff3de1da43
<?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
 */

namespace Joomla\CMS\Event\Result;

use InvalidArgumentException;

// phpcs:disable PSR1.Files.SideEffects
\defined('JPATH_PLATFORM') 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 any type. THIS IS A COP OUT! If you expect a nullable or union type it's best to implement
 * the typeCheckResult method yourself to check for the exact types you expect.
 *
 * @since  4.2.0
 */
trait ResultTypeMixedAware
{
    /**
     * 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
    {
        // Intentionally left blank; no type check is performed.
    }
}

The same content is in 27 releases, Joomla 4.2.1 to 4.3.1. See them all, or every version of this file.