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 | |
/** | |
* ```php | |
* echo (new FormParams())->set('name', 'x')->set('secondName', 'y'); // name=x&secondName=y | |
* ``` | |
*/ | |
class FormParams | |
{ | |
protected $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 | |
class First | |
{ | |
private $second; | |
public function __construct($second) | |
{ | |
$this->second = $second; | |
} |
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 | |
/** | |
* Route | |
* | |
* @param string $method | |
* @param string $path | |
* @param callable|array $callback | |
* @return void | |
*/ |
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 arrayToAttrs($attrs) | |
{ | |
if (!is_array($attrs)) { | |
return ''; | |
} | |
$result = ''; |
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 | |
$s = ' | |
/** | |
* Does something | |
* Some description | |
* | |
* @param string $type | |
* @return string | |
*/ |
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 | |
trait GetAndSet | |
{ | |
/** | |
* Magic method __call | |
* | |
* @param string $method | |
* @param array $params | |
* @return mixed |
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 Http; | |
class Url | |
{ | |
public $scheme; | |
public $host; | |
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 | |
trait CustomFunctionality | |
{ | |
protected $functions = []; | |
public function addMethod(string $name, callable $function) | |
{ | |
$this->functions[$name] = $function; | |
return $this; |
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 NonStaticTest | |
{ | |
public function execute() | |
{ | |
array_fill(0, 100, 'a'); | |
} | |
} |
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 | |
/** | |
* @param string|array | |
* @param string|array | |
* @param string | |
*/ | |
function implodeAssoc($glue, $arr, $key = null) | |
{ | |
if (is_array($l)) { |