- 2 Sites:
- TLM
- Grenette
- Utilisation des Sites:
- 20 aine de postes en RJ45
- 20 smartphone/tablette
- Quelques utilisateurs wifi
Materiel:
Materiel:
<?php | |
$mock = SimpleMock::mock('My\Class', array( | |
'getBar' => 'hello', | |
'doSomething' => function ($param) { | |
echo 'foo'; | |
}, | |
)); | |
// Same as |
Related tickets:
<?php | |
trait class ABetterNameHere | |
{ | |
public function someGenericMethod() | |
{ | |
// ... | |
} | |
} |
<?php | |
class Image | |
{ | |
private $width; | |
private $height; | |
private $content; | |
public static function createEmpty($width, $height, $bgcolor = null) | |
{ |
<?php | |
# Add the following to /etc/phpmyadmin/conf.d/export.inc.php | |
$cfg['Export']['sql_drop_database'] = true; | |
$cfg['Export']['sql_drop_table'] = true; | |
$cfg['Export']['compression'] = 'zip'; | |
$cfg['Export']['sql_disable_fk'] = true; | |
$cfg['Export']['sql_use_transaction'] = true; |
<?php | |
class MyTest extends PHPUnit_Framework_TestCase | |
{ | |
public function testSomeStuff() | |
{ | |
// Build my mock | |
$mock = new class extends CrawlerInterface { | |
public function crawl($url) { | |
return ['some', 'data']; |
The point of all this is that maybe YAML should be dropped altogether in favor of PHP definitions.
YAML is less verbose, but since PHP 5.4 (short arrays) and 5.5 (short class names) it's even.
Advantages of PHP:
<?php | |
interface Updatable | |
{ | |
public function apply(Expression $e); | |
} | |
// Solution 1 | |
// More powerful, but needs to parse and evaluate the string | |
class Expression | |
{ |
<?php | |
// http://3v4l.org/e9RNO | |
class Foo { | |
private $bar = 'hello world'; | |
} | |
class FriendOfFoo { | |
public function doSomething($foo) { | |
return function() use ($foo) { |