original_string: protected function parseMaxAge(ServerRequestInterface $request) : int
      {
          $item = $this->settings['maxAge'];
          // we allow callables to be set (along with strings) so we can vary things upon requests.
          if (true === is_callable($item)) {
              // all callbacks are made with the request as the second parameter.
              $item = call_user_func($item, $request);
          }
  
          // maxAge needs to be an int - if it isn't, throw an exception.
          if (false === is_int($item)) {
              throw new \InvalidArgumentException('maxAge should be an int value');
          }
  
          // if it is less than zero, reject it as "faulty"
          if ($item < 0) {
              throw new \InvalidArgumentException('maxAge should be 0 or more');
          }
  
          // return our integer maximum age to cache.
          return $item;
      }
code: protected function parseMaxAge(ServerRequestInterface $request) : int
      {
          $item = $this->settings['maxAge'];
          // we allow callables to be set (along with strings) so we can vary things upon requests.
          if (true === is_callable($item)) {
              // all callbacks are made with the request as the second parameter.
              $item = call_user_func($item, $request);
          }
  
          // maxAge needs to be an int - if it isn't, throw an exception.
          if (false === is_int($item)) {
              throw new \InvalidArgumentException('maxAge should be an int value');
          }
  
          // if it is less than zero, reject it as "faulty"
          if ($item < 0) {
              throw new \InvalidArgumentException('maxAge should be 0 or more');
          }
  
          // return our integer maximum age to cache.
          return $item;
      }
code_tokens: protected function parseMaxAge ( ServerRequestInterface $ request ) : int { $ item = $ this -> settings [ 'maxAge' ] ; // we allow callables to be set (along with strings) so we can vary things upon requests. if ( true === is_callable ( $ item ) ) { // all callbacks are made with the request as the second parameter. $ item = call_user_func ( $ item , $ request ) ; } // maxAge needs to be an int - if it isn't, throw an exception. if ( false === is_int ( $ item ) ) { throw new \ InvalidArgumentException ( 'maxAge should be an int value' ) ; } // if it is less than zero, reject it as "faulty" if ( $ item < 0 ) { throw new \ InvalidArgumentException ( 'maxAge should be 0 or more' ) ; } // return our integer maximum age to cache. return $ item ; }
docstring: Parse the maxAge setting.
  
  @param ServerRequestInterface $request What is the request object? (for callables).
  
  @throws \InvalidArgumentException If the item is missing from settings or is invalid.
  @return integer
docstring_tokens: Parse the maxAge setting .