This file contains hidden or 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 | |
$connection = new \AMQPConnection([ | |
'host' => '127.0.0.1', | |
'login' => 'guest', | |
'password' => 'guest', | |
'port' => 5672, | |
'vhost' => '/', | |
]); |
This file contains hidden or 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 | |
interface Adapter | |
{ | |
public function init($required); | |
} | |
// Warning: caller will pass 2 argument | |
class NotOk implements Adapter | |
{ | |
public function init($required){} |
This file contains hidden or 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 | |
class Charlie | |
{ | |
/** | |
* @deprecated | |
*/ | |
final public function __destruct() | |
{ | |
throw new NonRealisticCallException('Sorry, we are unable to complete your request'); |
This file contains hidden or 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 | |
function unserialize_callback($className) { | |
if (! class_exists($className)) { | |
throw new RuntimeException('class not found: ' . $className); | |
} else { | |
throw new RuntimeException('deserialization of ' . $className . ' failed'); | |
} | |
} |
This file contains hidden or 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 Application\Controller\Plugin; | |
use Zend\Mvc\Controller\Plugin\AbstractPlugin; | |
/** | |
* Use this object to replace the original prg controller's plugin for dev convenience. | |
*/ |
This file contains hidden or 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 | |
// constructor | |
class Void | |
{ | |
protected $mapper; | |
public function __construct(Mapper $mapper) | |
{ | |
$this->mapper = $mapper; |
This file contains hidden or 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 | |
class User { | |
private $password; | |
public function __construct($password) | |
{ | |
$this->password = $password; | |
} |
This file contains hidden or 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 | |
class SoapClient | |
{ | |
public function __call($method, $args) | |
{ | |
return $this; | |
} | |
public function __get($prop) |
This file contains hidden or 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 | |
function toto($pattern, $value) { | |
$split = preg_split($pattern, $value); | |
if ($error = error_get_last()) { | |
throw new Exception($error['message'], Exception::INVALID_PARAMETER); | |
} | |
} |
This file contains hidden or 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 | |
// Remplacer: | |
if (!$page) { | |
$response = new Response(); | |
$response->setStatusCode(404); | |
return $response; | |
} | |
// Par: |
NewerOlder