Skip to content

Commit d275c60

Browse files
authored
Merge pull request #9 from bavix/dev
Version 1.2.0
2 parents 762883e + 22b1309 commit d275c60

25 files changed

+598
-13
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ composer.phar
22
/vendor/
33
composer.lock
44
.idea/
5+
build/

.scrutinizer.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
build:
2+
3+
environment:
4+
php:
5+
version: 7.1
6+
7+
nodes:
8+
analysis:
9+
project_setup:
10+
override: true
11+
tests:
12+
override:
13+
- php-scrutinizer-run
14+
-
15+
command: 'vendor/bin/phpunit --coverage-clover=some-file'
16+
coverage:
17+
file: 'some-file'
18+
format: 'clover'
19+
20+
filter:
21+
excluded_paths: [tests/*, database/*, config/*]
22+
23+
checks:
24+
25+
php:
26+
remove_extra_empty_lines: true
27+
remove_php_closing_tag: true
28+
remove_trailing_whitespace: true
29+
30+
fix_use_statements:
31+
remove_unused: true
32+
preserve_multiple: false
33+
preserve_blanklines: true
34+
order_alphabetically: true
35+
36+
fix_php_opening_tag: true
37+
fix_linefeed: true
38+
fix_line_ending: true
39+
fix_identation_4spaces: true
40+
fix_doc_comments: true

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
language: php
2+
php:
3+
- '7.1'
4+
- '7.2'
5+
6+
before_script:
7+
- "composer install"

composer.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,22 @@
1414
"php": "^7.1",
1515
"laravel/framework": "~5.5.0|~5.6.0|~5.7.0"
1616
},
17+
"require-dev": {
18+
"doctrine/dbal": "^2.8",
19+
"mockery/mockery": "^1.2",
20+
"orchestra/testbench": "^3.7",
21+
"phpunit/phpunit": "^7.4"
22+
},
1723
"autoload": {
1824
"psr-4": {
1925
"Bavix\\Wallet\\": "src/"
2026
}
2127
},
28+
"autoload-dev": {
29+
"psr-4": {
30+
"Bavix\\Wallet\\Test\\": "tests/"
31+
}
32+
},
2233
"extra": {
2334
"laravel": {
2435
"providers": [

database/migrations/2018_11_07_202152_update_transfers_table.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<?php
22

3+
use Illuminate\Support\Facades\DB;
34
use Illuminate\Support\Facades\Schema;
45
use Illuminate\Database\Schema\Blueprint;
6+
use Illuminate\Database\SQLiteConnection;
57
use Illuminate\Database\Migrations\Migration;
68
use Bavix\Wallet\Models\Transfer;
79

@@ -38,9 +40,12 @@ public function up(): void
3840
public function down(): void
3941
{
4042
Schema::table($this->table(), function(Blueprint $table) {
41-
$table->dropIndex('from_to_refund_ind');
42-
$table->dropIndex('from_refund_ind');
43-
$table->dropIndex('to_refund_ind');
43+
if (!(DB::connection() instanceof SQLiteConnection)) {
44+
$table->dropIndex('from_to_refund_ind');
45+
$table->dropIndex('from_refund_ind');
46+
$table->dropIndex('to_refund_ind');
47+
}
48+
4449
$table->dropColumn('refund');
4550
});
4651
}

phpunit.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit bootstrap="vendor/autoload.php"
3+
backupGlobals="false"
4+
backupStaticAttributes="false"
5+
colors="true"
6+
verbose="true"
7+
convertErrorsToExceptions="true"
8+
convertNoticesToExceptions="true"
9+
convertWarningsToExceptions="true"
10+
processIsolation="false"
11+
stopOnFailure="false">
12+
<testsuites>
13+
<testsuite name="Wallet Test Suite">
14+
<directory>tests</directory>
15+
</testsuite>
16+
</testsuites>
17+
<filter>
18+
<whitelist>
19+
<directory suffix=".php">src/</directory>
20+
</whitelist>
21+
</filter>
22+
<logging>
23+
<log type="coverage-html" target="./build/html/"/>
24+
<log type="coverage-clover" target="./build/logs/clover.xml"/>
25+
</logging>
26+
</phpunit>

src/Exceptions/AmountInvalid.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
class AmountInvalid extends \InvalidArgumentException
66
{
7-
7+
88
}

src/Exceptions/BalanceIsEmpty.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
class BalanceIsEmpty extends \LogicException
66
{
7-
7+
88
}

src/Exceptions/ProductEnded.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
class ProductEnded extends \LogicException
66
{
7-
7+
88
}

src/Interfaces/Customer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ interface Customer extends Wallet
1010
/**
1111
* @param Product $product
1212
* @return Transfer
13-
* @throws
13+
* @throws
1414
*/
1515
public function pay(Product $product): Transfer;
1616

1717
/**
1818
* @param Product $product
1919
* @return null|Transfer
20-
* @throws
20+
* @throws
2121
*/
2222
public function safePay(Product $product): ?Transfer;
2323

@@ -30,7 +30,7 @@ public function paid(Product $product): ?Transfer;
3030
/**
3131
* @param Product $product
3232
* @return bool
33-
* @throws
33+
* @throws
3434
*/
3535
public function refund(Product $product): bool;
3636

0 commit comments

Comments
 (0)