ackintosh / toumi
Library to include the legacy code.
Installs: 3 536
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=5.3.0
Requires (Dev)
- phpunit/phpunit: ~5.0
This package is auto-updated.
Last update: 2024-10-16 09:38:11 UTC
README
A library for including legacy php file.
Usage
legacy.php
<?php function hoge($arg) { return 'hoge' . $arg; } somefunction(1234); function fuga() { $f = function () { echo 'fuga'; }; call_user_func($f); } var_dump(hoge('hogehoge')); exit;
<?php // Only function declaration is included. \Ackintosh\Toumi::load('legacy.php'); class LegacyTest extends PHPUnit_Framework_TestCase { /** * @test */ public function hoge() { $this->assertSame('hogefuga', hoge('fuga')); } }
Author
Akihito Nakano