~tsep-dev/tsep/tsep2

« back to all changes in this revision

Viewing changes to src/TSEP/Packagist/WebBundle/Repository/Provider/GitHubProvider.php

  • Committer: xaav
  • Date: 2011-10-01 18:10:50 UTC
  • Revision ID: git-v1:e1357bf55d2d528a58efeead2a02193370e17823
CS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php
2
 
 
3
 
namespace Packagist\WebBundle\Repository\Provider;
4
 
 
5
 
use Packagist\WebBundle\Repository\Repository\GitHubRepository;
6
 
 
7
 
class GitHubProvider implements ProviderInterface
8
 
{
9
 
    public function getRepository($url)
10
 
    {
11
 
        if($this->supports($url)){
12
 
            return new GitHubRepository($url);
13
 
        }
14
 
    }
15
 
 
16
 
    public function supports($url)
17
 
    {
18
 
        return preg_match('#^(?:https?|git)://github\.com/([^/]+)/(.+?)(?:\.git)?$#', $url, $match);
19
 
    }
20
 
}
 
 
b'\\ No newline at end of file'