Mistři v programování na #hovnokod

public function actionHtmlResponse()
{
	//FIXME: WTF?
	$query = $this->getHttpRequest()->getQuery();
	dump($this->datatablesHelper->getAllProductsForList($this, $query, $this->projectDomainId, $this->locale));
	exit;
}

Třešťák Huho,

foreach ($params as $p) {
	//TODO: make it better somehow, find potential bugs
	if ($p['parameter_type_id']) {
		$parameters[(int) $p['parameter_type_id']][] = $p->toArray();
	} else {
		$parameters[(int) $p['parameter_type_id']][] = $p->toArray();
	}
}

Třešťák Huho,

Bezpecnosti neni nikdy dost

if (isset($this->input['variant']) && $this->input['variant'] == "1") {
    if (!in_array($this->input['variant'], [0, 1])) {
        throw new SecurityBrokenException;
    }
}

Anonymous,


Anonymous,

Jak elegantne ziskat unix timestamp. Pravidelne se objevuje v projektu co ma 250k radku.

$celedatum = Date("Y-m-d H:i:s");
$celedatum1 = strtotime($celedatum);

Anonymous,