composer update

This commit is contained in:
Manish Verma
2018-12-05 10:50:52 +05:30
parent 9eabcacfa7
commit 4addd1e9c6
3328 changed files with 156676 additions and 138988 deletions

View File

@@ -0,0 +1,61 @@
<?php
/**
* This file is part of Gitonomy.
*
* (c) Alexandre Salomé <alexandre.salome@gmail.com>
* (c) Julien DIDIER <genzo.wm@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Gitonomy\Git\Reference;
use Gitonomy\Git\Exception\RuntimeException;
use Gitonomy\Git\Reference;
/**
* Representation of a branch reference.
*
* @author Alexandre Salomé <alexandre.salome@gmail.com>
*/
class Branch extends Reference
{
private $local = null;
public function getName()
{
$fullname = $this->getFullname();
if (preg_match('#^refs/heads/(?<name>.*)$#', $fullname, $vars)) {
return $vars['name'];
}
if (preg_match('#^refs/remotes/(?<remote>[^/]*)/(?<name>.*)$#', $fullname, $vars)) {
return $vars['remote'].'/'.$vars['name'];
}
throw new RuntimeException(sprintf('Cannot extract branch name from "%s"', $fullname));
}
public function isRemote()
{
$this->detectBranchType();
return !$this->local;
}
public function isLocal()
{
$this->detectBranchType();
return $this->local;
}
private function detectBranchType()
{
if (null === $this->local) {
$this->local = !preg_match('#^refs/remotes/(?<remote>[^/]*)/(?<name>.*)$#', $this->getFullname());
}
}
}

View File

@@ -0,0 +1,25 @@
<?php
/**
* This file is part of Gitonomy.
*
* (c) Alexandre Salomé <alexandre.salome@gmail.com>
* (c) Julien DIDIER <genzo.wm@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Gitonomy\Git\Reference;
use Gitonomy\Git\Reference;
/**
* @author Alexandre Salomé <alexandre.salome@gmail.com>
*/
class Stash extends Reference
{
public function getName()
{
return 'stash';
}
}

View File

@@ -0,0 +1,32 @@
<?php
/**
* This file is part of Gitonomy.
*
* (c) Alexandre Salomé <alexandre.salome@gmail.com>
* (c) Julien DIDIER <genzo.wm@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Gitonomy\Git\Reference;
use Gitonomy\Git\Exception\RuntimeException;
use Gitonomy\Git\Reference;
/**
* Representation of a tag reference.
*
* @author Alexandre Salomé <alexandre.salome@gmail.com>
*/
class Tag extends Reference
{
public function getName()
{
if (!preg_match('#^refs/tags/(.*)$#', $this->revision, $vars)) {
throw new RuntimeException(sprintf('Cannot extract tag name from "%s"', $this->revision));
}
return $vars[1];
}
}