1. Список говнокодов пользователя mobileka

    Всего: 2

  2. PHP / Говнокод #14430

    +155

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    try
    {
      return ($image = $this->row->image()->first())
        ? $image->{$this->imageAlias}
        : dummyThumbnail($this->imageAlias)
      ;
    }
    catch(\Exception $e)
    {
      if ($e->getMessage() === 'Method [image] is not defined on the Query class.')
      {
          $val = parent::value();
          return (is_string($val) and \Str::contains($val, 'http://'))
            ? $val
            : $this->row->getImageSrc($this->name, $this->imageAlias)
          ;
      }
    
      throw new \Exception($e->getMessage(), $e->getCode());
    }

    mobileka, 28 Января 2014

    Комментарии (96)
  3. PHP / Говнокод #8070

    +163

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    function empty_object() {
    		$company = new stdClass();
    		$company->id = $company->fullName = $company->city_id = $company->district_id = $company->img = '';
    		$company->isApproved = $company->definition = $company->bussiness_type = $company->key_words	= '';
    		$company->slogan = $company->org_rnn = $company->org_ownership = $company->org_full_name		= '';
    		$company->org_name = $company->index = $company->city = $company->street_type = $company->street = '';
    		$company->home = $company->office = $company->index2 = $company->region2= '';
    		$company->city2 = '202.00';
    		$company->street_type2 = $company->street2 = $company->home2 = $company->office2 = $company->email = '';
    		$company->site = $company->facebook = $company->twitter = $company->vk = $company->mailru = '';
    		$company->orientir = $company->corner = $company->bus = $company->trol = $company->tram	= '';
    		$company->taxi = $company->cont_surname = $company->cont_name = $company->cont_secondname = '';
    		$company->cont_position = $company->cont_phone = $company->cont_mobile = $company->workdays = $company->workdayoffs = '' ;
    		$company->work_hour = $company->work_min = $company->work_hour2 = $company->work_min2 = $company->break_hour = '';
    		$company->break_min = $company->break_hour2 = $company->break_min2 = $company->contract_num	= '';
    		$company->work_hour_dayoff = $company->work_min_dayoff = $company->work_hour2_dayoff = $company->work_min2_dayoff = $company->break_hour_dayoff = '';
    		$company->break_min_dayoff = $company->break_hour2_dayoff = $company->break_min2_dayoff = '';
    		$company->contract_price = $company->contract_day = $company->contract_month = $company->contract_year ='';
    		$company->contract_day2 = $company->contract_month2 = $company->contract_year2	= $company->tp_surname ='';
    		$company->tp_name = $company->tp_secondname = $company->tp_code = $company->tp_request_day = '';
    		$company->tp_request_month = $company->tp_request_year	= $company->tp_request_hour	= '';
    		$company->tp_request_min = $company->tp_phone = $company->tp_email = $company->phone1 = $company->service1 ='';
    		$company->address1 = $company->phone2 = $company->service2 = $company->address2 = $company->phone3 = '';
    		$company->service3 = $company->address3 = $company->phone4 = $company->service4 = $company->address4 = '';
    		$company->phone5 = $company->service5 = $company->address5 = '';
    		$company->map = '';
    		return $company;
    	}

    Человек таким образом создает пустой объект компании... чтобы сформировать форму... и для этого он прописал в поле city2 (что есть по его логике id города в фактическом адресе).

    mobileka, 03 Октября 2011

    Комментарии (9)