This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace { | |
class A {} | |
var_dump(class_alias('A', 'B')); // => bool(true) | |
$reflector = new \ReflectionClass('B'); | |
var_dump($reflector->getName()); // => string(1) "A" | |
} | |
namespace jubianchi\Alias { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "atoum-praspel", | |
"type": "script", | |
"description": "", | |
"authors": [ | |
{ | |
"name": "Julien Bianchi", | |
"email": "contact@jubianchi.fr", | |
"homepage": "http://jubianchi.fr" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
aop_add_before('printf()', function($jp) { | |
echo 'Hey, I\'m being magically called before printf !' . PHP_EOL; | |
}); | |
aop_add_after('printf()', function($jp) { | |
echo 'AOP-PHP is really awesome !' . PHP_EOL; | |
}); | |
aop_add_around('date()', function($jp) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Start your VM either manually or using vboxmanage | |
# | |
# /!\ The VM has to be started in non-headless mode for this script to work | |
# When you want to make it headless (dettached window) use | |
$ vboxsw "VM Name" d | |
# When you want to get the window back use | |
$ vboxsw "VM Name" a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use | |
mageekguy\atoum\scripts\treemap, | |
mageekguy\atoum\scripts\treemap\analyzers, | |
mageekguy\atoum\scripts\treemap\categorizer | |
; | |
$testsDirectory = __DIR__ . DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
stashstash = "!f() { STASH=$(git stash); echo \"\\033[0;31mKouroukoukou roukoukou stash stash\\033[0m\"; echo \"$STASH\"; xdg-open \"http://www.youtube.com/watch?v=LpE1bJp8-4w&feature=youtu.be&t=47s\" > /dev/null 2>&1 & }; f" | |
satsh = !git stashstash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace jubianchi { | |
class foo { | |
public function __construct($foo, $bar) { | |
echo $foo . '-' . $bar; | |
} | |
} | |
} | |
namespace tests\units\jubianchi { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace foo { | |
interface client | |
{ | |
public function execute($query, array $params); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Acme\DemoBundle\Tests\Controller; | |
require_once __DIR__ . '/../../../../vendor/autoload.php'; | |
require_once __DIR__ . '/../../../../vendor/atoum/atoum/scripts/runner.php'; | |
use atoum\AtoumBundle\Test\Controller; | |
class DemoController extends Controller\ControllerTest | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use \mageekguy\atoum; | |
function colorized() { | |
$color = -1; | |
if(false !== ($term = getenv('TERM'))) { | |
if(preg_match('/\d+/', $term, $matches) > 0) { | |
$color = $matches[0]; | |
} | |
} |