public function shippingMethod(array $values)
    {
        $existing = array_filter($values, function ($method_id) {
            return (bool) $this->shipping->get($method_id);
        });

        if (count($values) != count($existing)) {
            return $this->translation->text('@name is unavailable', array(
                '@name' => $this->translation->text('Shipping')));
        }

        return true;
    }
public function shippingMethod(array $values)
    {
        $existing = array_filter($values, function ($method_id) {
            return (bool) $this->shipping->get($method_id);
        });

        if (count($values) != count($existing)) {
            return $this->translation->text('@name is unavailable', array(
                '@name' => $this->translation->text('Shipping')));
        }

        return true;
    }
public function shippingMethod ( array $ values ) { $ existing = array_filter ( $ values , function ( $ method_id ) { return ( bool ) $ this -> shipping -> get ( $ method_id ) ; } ) ; if ( count ( $ values ) != count ( $ existing ) ) { return $ this -> translation -> text ( '@name is unavailable' , array ( '@name' => $ this -> translation -> text ( 'Shipping' ) ) ) ; } return true ; }
Validates the shipping method condition
@param array $values
@return boolean|string
Validates the shipping method condition