Skip to content

Commit

Permalink
Some little fixes (#2)
Browse files Browse the repository at this point in the history
> Code Covarage 💯 % #1 
> Connect TravisCI with Scrutinizer 👍 
> Some minor changes
  • Loading branch information
SamAsEnd authored Sep 12, 2016
1 parent 1ea539c commit 559361c
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 13 deletions.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ php:

install: travis_retry composer install --no-interaction --prefer-source

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

after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ Andegna Geezify
===============

[![Build Status](https://travis-ci.org/andegna/geezify.svg?branch=master)](https://travis-ci.org/andegna/geezify)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/andegna/geezify/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/andegna/geezify/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/andegna/geezify/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/andegna/geezify/?branch=master)
[![Total Downloads](https://poser.pugx.org/andegna/geezify/d/total.svg)](https://packagist.org/packages/andegna/geezify)
[![Latest Stable Version](https://poser.pugx.org/andegna/geezify/v/stable.svg)](https://packagist.org/packages/andegna/geezify)
[![Latest Unstable Version](https://poser.pugx.org/andegna/geezify/v/unstable.svg)](https://packagist.org/packages/andegna/geezify)
[![License](https://poser.pugx.org/andegna/geezify/license.svg)](https://packagist.org/packages/andegna/geezify)

This package is a simple library to convert ascii number '3456' to geez number '፴፬፻፶፮'.
This package is a simple library to convert ascii number '**3456**' to geez number '**፴፬፻፶፮**'.

Installation
------------
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"extra": {
"branch-alias": {
"develop": "1.0.x-dev"
"dev-master": "1.0.x-dev"
}
}
}
7 changes: 7 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,11 @@
<directory suffix="Test.php">tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory suffix=".php">./src</directory>
</whitelist>
</filter>

</phpunit>
14 changes: 5 additions & 9 deletions src/Geezify.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ protected function combineNumberAndSeparator($geezNumber, $separator, $index)
protected function shouldRemoveGeezSeparator($block, $separator)
{
return
empty($block) and
empty($block) &&
$this->isGeezNumber100($separator);
}

Expand All @@ -245,10 +245,6 @@ protected function isGeezNumber100($separator)
*/
protected function isGeezNumber($geez_number, $number)
{
if (!isset(static::$GEEZ_NUMBERS[$number])) {
return false;
}

return $geez_number === static::$GEEZ_NUMBERS[$number];
}

Expand All @@ -261,7 +257,7 @@ protected function isGeezNumber($geez_number, $number)
protected function shouldRemoveGeezNumberBlock($block, $separator, $index)
{
return
$this->isOneHundred($block, $separator) or
$this->isOneHundred($block, $separator) ||
$this->isLeadingTenThousand($block, $separator, $index);
}

Expand All @@ -274,7 +270,7 @@ protected function shouldRemoveGeezNumberBlock($block, $separator, $index)
protected function isOneHundred($block, $separator)
{
return
$this->isGeezNumber100($separator) and
$this->isGeezNumber100($separator) &&
$this->isGeezNumberOne($block);
}

Expand All @@ -298,8 +294,8 @@ protected function isGeezNumberOne($geez)
protected function isLeadingTenThousand($block, $separator, $index)
{
return
$this->isZero($index) and
$this->isGeezNumberOne($block) and
$this->isZero($index) &&
$this->isGeezNumberOne($block) &&
$this->isGeezNumberTenThousand($separator);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/GeezifyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public function geezNumberTestDataProvider()
*
* @dataProvider geezNumberTestDataProvider
*/
public function testGeezConvert($number, $geez_number)
public function test_geez_convert($number, $geez_number)
{
$actual = $this->geezify->convert($number);

Expand Down

0 comments on commit 559361c

Please sign in to comment.