Wordpress/tests/phpunit/includes/factory/class-wp-unittest-factory-callback-after-create.php
Gary Pendergast ae62335191 Docs: Add docblocks for the PHPUnit factory objects.
Props andizer.
Fixes #44521.


git-svn-id: https://develop.svn.wordpress.org/trunk@44497 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-09 05:43:14 +00:00

30 lines
556 B
PHP

<?php
class WP_UnitTest_Factory_Callback_After_Create {
/**
* @var callable
*/
var $callback;
/**
* WP_UnitTest_Factory_Callback_After_Create constructor.
*
* @param callable $callback A callback function.
*/
function __construct( $callback ) {
$this->callback = $callback;
}
/**
* Calls the set callback on given object.
*
* @param mixed $object The object to apply the callback on.
*
* @return mixed The possibly altered object.
*/
function call( $object ) {
return call_user_func( $this->callback, $object );
}
}