code: protected function getIndex(ViewController $compare = null)
      {
          if (is_null($compare)) {
              return null;
          }
  
          $index = null;
          foreach ($this->elements as $i => $element) {
              if ($element === $compare) {
                  $index = $i;
              }
          }
  
          return $index;
      }
docs: @param ViewController $compare
  
  @return int|null