Redaxscript\Router\Parameter::getThird PHP Method

getThird() public method

get the third parameter
Since: 2.4.0
public getThird ( ) : string
return string
    public function getThird()
    {
        if (array_key_exists(2, $this->_parameterArray) && !is_numeric($this->_parameterArray[2])) {
            return $this->_parameterArray[2];
        }
    }

Usage Example

Example #1
0
 /**
  * testGetThird
  *
  * @since 2.4.0
  *
  * @param string $route
  * @param array $expectArray
  *
  * @dataProvider providerParameter
  */
 public function testGetThird($route = null, $expectArray = [])
 {
     /* setup */
     $this->_request->setQuery('p', $route);
     $parameter = new Router\Parameter($this->_request);
     $parameter->init();
     /* actual */
     $actual = $parameter->getThird();
     /* compare */
     $this->assertEquals($expectArray['third'], $actual);
 }