public function add(ParamConverterInterface $converter, $priority = 0, $name = null)
    {
        if (null !== $priority) {
            if (!isset($this->converters[$priority])) {
                $this->converters[$priority] = [];
            }

            $this->converters[$priority][] = $converter;
        }

        if (null !== $name) {
            $this->namedConverters[$name] = $converter;
        }
    }
public function add(ParamConverterInterface $converter, $priority = 0, $name = null)
    {
        if (null !== $priority) {
            if (!isset($this->converters[$priority])) {
                $this->converters[$priority] = [];
            }

            $this->converters[$priority][] = $converter;
        }

        if (null !== $name) {
            $this->namedConverters[$name] = $converter;
        }
    }
public function add ( ParamConverterInterface $ converter , $ priority = 0 , $ name = null ) { if ( null !== $ priority ) { if ( ! isset ( $ this -> converters [ $ priority ] ) ) { $ this -> converters [ $ priority ] = [ ] ; } $ this -> converters [ $ priority ] [ ] = $ converter ; } if ( null !== $ name ) { $ this -> namedConverters [ $ name ] = $ converter ; } }
Adds a parameter converter.

Converters match either explicitly via $name or by iteration over all
converters with a $priority. If you pass a $priority = null then the
added converter will not be part of the iteration chain and can only
be invoked explicitly.

@param int    $priority the priority (between -10 and 10)
@param string $name     name of the converter
Adds a parameter converter .