Skip to content

Commit

Permalink
Merge branch 'release/v1.0.14'
Browse files Browse the repository at this point in the history
  • Loading branch information
matteosister committed Sep 18, 2015
2 parents 99b51ce + 876b23d commit 7db4e7f
Show file tree
Hide file tree
Showing 25 changed files with 87 additions and 160 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ output/
composer.phar
build/
cache/
deploy_docs.sh
deploy_docs.sh
62 changes: 29 additions & 33 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,34 @@
before_commands:
- git --version
- git config --global user.email "[email protected]"
- git config --global user.name "git-elephant"
- composer install
- git --version
- git config --global user.email "[email protected]"
- git config --global user.name "git-elephant"
- composer install
filter:
excluded_paths:
- 'vendor/*'
tools:
php_code_coverage:
enabled: true
filter:
paths: [ src/* ]
excluded_paths: [ tests/*, graphics/*, vendor/* ]
test_command: ./vendor/bin/phpunit
php_code_sniffer:
enabled: true
filter:
paths: [ src/ ]
config:
# Built-in standards: PEAR, PHPCS, PSR1, PSR2, Squiz, Zend
standard: PSR2
php_cpd:
enabled: true
php_cs_fixer:
enabled: true
config:
level: psr2
filter:
paths: [ src/ ]
php_mess_detector:
enabled: true
filter:
paths: [ src/ ]
php_analyzer: true
sensiolabs_security_checker: true
php_pdepend: true
php_loc: true
external_code_coverage:
timeout: 600
php_code_sniffer:
enabled: true
filter:
paths: [ src/ ]
config:
# Built-in standards: PEAR, PHPCS, PSR1, PSR2, Squiz, Zend
standard: PSR2
php_cpd:
enabled: true
php_cs_fixer:
enabled: true
config:
level: psr2
filter:
paths: [ src/ ]
php_mess_detector:
enabled: true
filter:
paths: [ src/ ]
php_analyzer: true
sensiolabs_security_checker: true
php_pdepend: true
php_loc: true
36 changes: 15 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
language: php

php:
- 5.3
- 5.4
- 5.5
- 5.6
- hhvm

matrix:
allow_failures:
- 5.3
- 5.4
- 5.5
- 5.6
- hhvm

branches:
only:
- master
- develop

before_script:
- curl -s https://getcomposer.org/installer | php
- $(which php) composer.phar --dev install
- git --version
- git config --global user.email "[email protected]"
- git config --global user.name "Travis"
- git --version
- curl -s https://getcomposer.org/installer | php
- $(which php) composer.phar --dev install
- git --version
- git config --global user.email "[email protected]"
- git config --global user.name "Travis"
- git --version

script:
- vendor/bin/phpunit

- vendor/bin/phpunit --coverage-clover=coverage.clover

after_success:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM php

RUN apt-get update && apt-get install -qqy git && rm -r /var/lib/apt/lists/*
RUN git config --global user.email "[email protected]"
RUN git config --global user.name "gitelephant"

RUN docker-php-ext-install mbstring
RUN pecl install xdebug
RUN echo "zend_extension = `php-config --extension-dir`/xdebug.so" >> /usr/local/etc/php/php.ini

WORKDIR /app
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Latest Stable Version](https://poser.pugx.org/cypresslab/GitElephant/v/stable.png)](https://packagist.org/packages/cypresslab/GitElephant) [![License](https://poser.pugx.org/cypresslab/gitelephant/license.png)](https://packagist.org/packages/cypresslab/gitelephant) [![Total Downloads](https://poser.pugx.org/cypresslab/GitElephant/downloads.png)](https://packagist.org/packages/cypresslab/GitElephant) [![Montly Downloads](https://poser.pugx.org/cypresslab/gitelephant/d/monthly.png)](https://packagist.org/packages/cypresslab/gitelephant)

[![Build Status](https://travis-ci.org/matteosister/GitElephant.png?branch=master)](https://travis-ci.org/matteosister/GitElephant) [![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/matteosister/GitElephant/badges/quality-score.png?s=c7ca8a7c5ea9c64b291f6bcaef27955ed6d8a836)](https://scrutinizer-ci.com/g/matteosister/GitElephant/) [![Code Coverage](https://scrutinizer-ci.com/g/matteosister/GitElephant/badges/coverage.png?s=fd7981a4f57fd639912d1a415e3dd92615ddce51)](https://scrutinizer-ci.com/g/matteosister/GitElephant/) [![SensioLabsInsight](https://insight.sensiolabs.com/projects/d6da541e-d928-4f70-868a-dd0b6426a7b5/mini.png)](https://insight.sensiolabs.com/projects/d6da541e-d928-4f70-868a-dd0b6426a7b5)
[![Build Status](https://travis-ci.org/matteosister/GitElephant.png?branch=master)](https://travis-ci.org/matteosister/GitElephant) [![Dependency Status](https://www.versioneye.com/user/projects/53da38094b3ac86052000019/badge.svg?style=flat)](https://www.versioneye.com/user/projects/53da38094b3ac86052000019) [![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/matteosister/GitElephant/badges/quality-score.png?s=c7ca8a7c5ea9c64b291f6bcaef27955ed6d8a836)](https://scrutinizer-ci.com/g/matteosister/GitElephant/) [![Code Coverage](https://scrutinizer-ci.com/g/matteosister/GitElephant/badges/coverage.png?s=fd7981a4f57fd639912d1a415e3dd92615ddce51)](https://scrutinizer-ci.com/g/matteosister/GitElephant/) [![SensioLabsInsight](https://insight.sensiolabs.com/projects/d6da541e-d928-4f70-868a-dd0b6426a7b5/mini.png)](https://insight.sensiolabs.com/projects/d6da541e-d928-4f70-868a-dd0b6426a7b5)

GitElephant is an abstraction layer to manage your git repositories with php

Expand Down
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
php:
build: .
volumes:
- ".:/app"
5 changes: 0 additions & 5 deletions docker-test

This file was deleted.

34 changes: 0 additions & 34 deletions docker/1.8.5.3

This file was deleted.

34 changes: 0 additions & 34 deletions docker/1.9.2

This file was deleted.

3 changes: 0 additions & 3 deletions docker/setup

This file was deleted.

1 change: 0 additions & 1 deletion src/GitElephant/Command/BaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

use \GitElephant\Repository;
use \PhpCollection\Map;
use \PhpCollection\Sequence;

/**
* BaseCommand
Expand Down
2 changes: 1 addition & 1 deletion src/GitElephant/Command/Caller/Caller.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function execute($cmd, $git = true, $cwd = null, $acceptedExitCodes = arr
$cmd = $this->binary->getPath() . ' ' . $cmd;
}

$process = new Process($cmd, $cwd == null ? $this->repositoryPath : $cwd);
$process = new Process($cmd, is_null($cwd) ? $this->repositoryPath : $cwd);
$process->setTimeout(15000);
$process->run();
if (!in_array($process->getExitCode(), $acceptedExitCodes)) {
Expand Down
4 changes: 2 additions & 2 deletions src/GitElephant/Command/DiffCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ public function diff($of, $with = null, $path = null)

$subject = '';

if ($with == null) {
if (is_null($with)) {
$subject .= $of.'^..'.$of;
} else {
$subject .= $with.'..'.$of;
}

if ($path != null) {
if (! is_null($path)) {
if (!is_string($path)) {
/** @var Object $path */
$path = $path->getPath();
Expand Down
2 changes: 1 addition & 1 deletion src/GitElephant/Command/LsTreeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function tree($ref = 'HEAD', $path = null)
*/
public function listAll($ref = null)
{
if ($ref == null) {
if (is_null($ref)) {
$ref = 'HEAD';
}
$this->clearAll();
Expand Down
2 changes: 1 addition & 1 deletion src/GitElephant/Command/MainCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function unstage($what)
public function commit($message, $stageAll = false, $author = null, $allowEmpty = false)
{
$this->clearAll();
if (trim($message) == '' || $message == null) {
if (trim($message) === '' || is_null($message)) {
throw new \InvalidArgumentException(sprintf('You can\'t commit without message'));
}
$this->addCommandName(self::GIT_COMMIT);
Expand Down
1 change: 0 additions & 1 deletion src/GitElephant/Command/RevParseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
namespace GitElephant\Command;

use \GitElephant\Objects\Branch;
use \GitElephant\Objects\Remote;
use \GitElephant\Repository;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/GitElephant/Command/SubCommandCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function getCommand()
{
$command = $this->getCommandName();

if ($command == null) {
if (is_null($command)) {
throw new \RuntimeException("commandName must be specified to build a subcommand");
}

Expand Down
2 changes: 1 addition & 1 deletion src/GitElephant/Command/SubmoduleCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function update($recursive = false, $init = false, $force = false, $path
if ($recursive === true) {
$this->addCommandArgument(self::SUBMODULE_OPTION_RECURSIVE);
}
if ($init == true) {
if ($init === true) {
$this->addCommandArgument(self::SUBMODULE_OPTION_INIT);
}
if ($force === true) {
Expand Down
2 changes: 1 addition & 1 deletion src/GitElephant/Command/TagCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function create($name, $startPoint = null, $message = null)
{
$this->clearAll();
$this->addCommandName(self::TAG_COMMAND);
if (null != $message) {
if (null !== $message) {
$this->addCommandArgument('-m');
$this->addCommandArgument($message);
}
Expand Down
2 changes: 1 addition & 1 deletion src/GitElephant/GitBinary.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class GitBinary
*/
public function __construct($path = null)
{
if (null == $path) {
if (is_null($path)) {
// unix only!
$path = exec('which git');
}
Expand Down
2 changes: 1 addition & 1 deletion src/GitElephant/Objects/Object.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public function getMimeType($basePath)
public function getExtension()
{
$pos = strrpos($this->name, '.');
if ($pos == false) {
if ($pos === false) {
return null;
} else {
return substr($this->name, $pos+1);
Expand Down
6 changes: 3 additions & 3 deletions src/GitElephant/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class Repository
*/
public function __construct($repositoryPath, GitBinary $binary = null, $name = null)
{
if ($binary == null) {
if (is_null($binary)) {
$binary = new GitBinary();
}

Expand Down Expand Up @@ -282,15 +282,15 @@ public function remove($path, $recursive = false, $force = false)
public function commit($message, $stageAll = false, $ref = null, $author = null, $allowEmpty = false)
{
$currentBranch = null;
if ($ref != null) {
if (! is_null($ref)) {
$currentBranch = $this->getMainBranch();
$this->checkout($ref);
}
if ($stageAll) {
$this->stage();
}
$this->caller->execute(MainCommand::getInstance($this)->commit($message, $stageAll, $author, $allowEmpty));
if ($ref != null) {
if (! is_null($ref)) {
$this->checkout($currentBranch);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/GitElephant/Command/BaseCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class BaseCommandTest extends TestCase
/**
* test class constructor
*
* @covers BaseCommand::__construct
* @covers GitElephant\Command\BaseCommand::__construct
*/
public function testConstructor()
{
Expand Down Expand Up @@ -59,7 +59,7 @@ public function testConstructor()
/**
* test static factory
*
* @covers BaseCommand::getInstance
* @covers GitElephant\Command\BaseCommand::getInstance
*/
public function testGetInstance()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/GitElephant/Objects/ObjectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ public function testRevParse()
/**
* test repository getter and setter
*
* @covers Object::getRepository
* @covers Object::setRepository
* @covers GitElephant\Objects\Object::getRepository
* @covers GitElephant\Objects\Object::setRepository
*/
public function testGetSetRepository()
{
Expand Down
Loading

0 comments on commit 7db4e7f

Please sign in to comment.