original_string: public function repository_from_url(string $url, bool $obj = false){
      $repository = '';
      $repositories = $this->repositories();
  
      foreach ( $repositories as $i => $d ){
        if ( (strpos($url, $i) === 0) &&
          (\strlen($i) > \strlen($repository) )
        ){
          $repository = $i;
        }
      }
      if ( !empty($repository) ){
        return empty($obj) ? $repository : $repositories[$repository];
      }
      return false;
    }
code: public function repository_from_url(string $url, bool $obj = false){
      $repository = '';
      $repositories = $this->repositories();
  
      foreach ( $repositories as $i => $d ){
        if ( (strpos($url, $i) === 0) &&
          (\strlen($i) > \strlen($repository) )
        ){
          $repository = $i;
        }
      }
      if ( !empty($repository) ){
        return empty($obj) ? $repository : $repositories[$repository];
      }
      return false;
    }
code_tokens: public function repository_from_url ( string $ url , bool $ obj = false ) { $ repository = '' ; $ repositories = $ this -> repositories ( ) ; foreach ( $ repositories as $ i => $ d ) { if ( ( strpos ( $ url , $ i ) === 0 ) && ( \ strlen ( $ i ) > \ strlen ( $ repository ) ) ) { $ repository = $ i ; } } if ( ! empty ( $ repository ) ) { return empty ( $ obj ) ? $ repository : $ repositories [ $ repository ] ; } return false ; }
docstring: Returns the repository's name or object from an URL.
  
  @param string $url
  @param bool $obj
  @return bool|int|string
docstring_tokens: Returns the repository s name or object from an URL .