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 | |
| $segments = ['one', 'two', 'three']; | |
| $copy = $segments; | |
| $assoc = []; | |
| foreach ($segments as $key => $seg) | |
| { | |
| $segment = next($copy); |
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 | |
| $clone = new ArrayCollection; | |
| $steps = 10000; | |
| $instances = []; | |
| $start['new'] = microtime(true); | |
| foreach (range(1, $steps) as $k) { | |
| $instances[] = new ArrayCollection; | |
| } |
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
| 'doctrine' => | |
| [ | |
| 'configuration' => | |
| [ | |
| 'orm_default' => | |
| [ | |
| 'string_functions' => | |
| [ | |
| 'func_name' => 'class_name' | |
| ], |
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 | |
| 'router' => | |
| [ | |
| // Active le support du translator pour les portions de route marquées par {translation_key} | |
| // Il faut lui injecter un translator | |
| 'router_class' => 'Zend\Mvc\Router\Http\TranslatorAwareTreeRouteStack', | |
| // Valeurs par défaut pour toutes les routes | |
| 'default_params' => |
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: |
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 | |
| 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 | |
| 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 | |
| // 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 | |
| namespace Application\Controller\Plugin; | |
| use Zend\Mvc\Controller\Plugin\AbstractPlugin; | |
| /** | |
| * Use this object to replace the original prg controller's plugin for dev convenience. | |
| */ |