Mistři v programování na #hovnokod

Kdo to vi, odpovi, odpovi mi na otazku ...

 ///   Framework pomoci trochy magie tuto klasu bere jako AddressFormat
///
class AddressFormatCore extends ObjectModel           
{

         /**
	 * Returns address format by country if not defined using default country
	 *
	 * @param Integer PS_COUNTRY.id
	 * @return String field address format
	 */

	public static function getAddressCountryFormat($id_country = 0)                 ///  chci vedet format zeme ?
	{
		$id_country = (int)$id_country;

		$tmp_obj = new AddressFormat();                                             ///  vyrobim samu sebe 
		$tmp_obj->id_country = $id_country;                                         ///  nastavim si zemi
		$out = $tmp_obj->getFormat($tmp_obj->id_country);                ///  a zeptam se na format zeme kterou jsem prave nastavil
		unset($tmp_obj);                                                                        ///  pak provedu rucne garbage collection
		return $out;
	}
/**

Pouziti:
   AddressFormat::getAddressCountryFormat($id_country);

*/

}

Anonymous,

Ked sa nahodou porusia fyzikalne zakony, radsej tu stranku vypni.

if (2==1) {
	vypni_stranku('', TRUE);	
}

Matej Evin,

Do dnesneho dna neviem co tym chcel autor povedat...

public function store(Request $request)
{
    $providers = collect();
    $fields = $this->getFields();
    foreach ($request->all() as $service_provider) {
        if ($errors = parent::validate_target(new Request(collect($service_provider)->except($fields)->all()), 'serviceprovider') . contains(['valid' => true])) {
            $new_provider = new ServiceProvider(collect($service_provider)->except($fields)->all());
            if ($new_provider->save()) {
                foreach ($fields as $field) {
                    if (isset($service_provider[$field])) {
                        if ($errors = parent::validate_target(new Request($service_provider[$field]), parent::removePlurals($field)) . contains(['valid' => true])) {
                            $path = $this->getPath($field);
                            $path::store($new_provider, $service_provider[$field]);
                        }
                    } else {
                        return response()->json($errors, 400);
                    }
                }
                $providers->push(collect($new_provider));
            }
        } else {
            return response()->json($errors, 400);
        }
    }
    if ($providers->count() == 0) {
        return response()->json('Invalid service provider request', 400);
    }
    return response()->json($providers);
}

Jerguš Lejko,

Snaha byla... :-)

foreach($_REQUEST as $prem => $val)
{
    $val=addslashes($val);
    eval("$".$prem."=\"".$val."\";");
}

Anonymous,


Anonymous,