Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions spec/WP_wrapperSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@
namespace spec\MrKoopie\WP_wrapper;

use PhpSpec\ObjectBehavior;
use Prophecy\Argument;

class WP_wrapperSpec extends ObjectBehavior
{
function it_is_initializable()
public function it_is_initializable()
{
$this->shouldHaveType('MrKoopie\WP_wrapper\WP_wrapper');
}

function it_can_get_the_date()
public function it_can_get_the_date()
{
self::print_r('Y',1)
->shouldBeEqualTo(print_r('Y', 1));
self::print_r('Y', 1)
->shouldBeEqualTo(print_r('Y', 1));
}
}
44 changes: 24 additions & 20 deletions src/WP_wrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,29 @@

class WP_wrapper
{
/**
* Call $function in the root namespace and pass the arguments.
* @param string $function The $function name.
* @param array $arguments The parameters for $function.
* @return various Returned data by the function.
*/
public static function __callStatic($function, $arguments)
{
return call_user_func_array( '\\'.$function, $arguments);
}
/**
* Call $function in the root namespace and pass the arguments.
*
* @param string $function The $function name.
* @param array $arguments The parameters for $function.
*
* @return various Returned data by the function.
*/
public static function __callStatic($function, $arguments)
{
return call_user_func_array('\\'.$function, $arguments);
}

/**
* Call $function in the root namespace and pass the arguments.
* @param string $function The $function name.
* @param array $arguments The parameters for $function.
* @return various Returned data by the function.
*/
public function __call($function, $arguments)
{
return call_user_func_array( '\\'.$function, $arguments);
}
/**
* Call $function in the root namespace and pass the arguments.
*
* @param string $function The $function name.
* @param array $arguments The parameters for $function.
*
* @return various Returned data by the function.
*/
public function __call($function, $arguments)
{
return call_user_func_array('\\'.$function, $arguments);
}
}