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

    Всего: 1

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

    −11

    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
    /**
     * @param $parentId
     * @param $parentType
     * @return array
     */
    public static function getReports( $parentId, $parentType )
    {
        $redis = Redis::connection();
        $r = array(
            'inappropriate'=> (int) $redis->scard(__CLASS__.":report:".$parentId.":".$parentType.":inappropriate"),
            'copyright'=>(int) $redis->scard(__CLASS__.":report:".$parentId.":".$parentType.":copyright"),
            'harassment'=>(int) $redis->scard(__CLASS__.":report:".$parentId.":".$parentType.":harassment")
        );
    
        $r['all'] = $r['inappropriate']+$r['copyright']+$r['harassment'];
    
        return $r;
    }

    Попробуйте разобртаться без поллитры

    keltanas, 05 Октября 2015

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