Skip to content

Commit

Permalink
Upgraded PHP version(>=7.2)
Browse files Browse the repository at this point in the history
Changed namespace
  • Loading branch information
stk2k committed Jun 5, 2021
1 parent 58ea417 commit 3deaf25
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 86 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -5,3 +5,6 @@ vendor/*
build/*
coverage/*
sample/cache/*
test/files/cache/*
test/cache/*
.phpunit.result.cache
1 change: 1 addition & 0 deletions .travis.php.ini
@@ -0,0 +1 @@
xdebug.mode=coverage
8 changes: 5 additions & 3 deletions .travis.yml
@@ -1,18 +1,20 @@
language: php

php:
- 7.1
- 7.2
- 7.3
- 7.4
- 8.0

before_script:
- phpenv config-add .travis.php.ini
- composer install

script:
- echo $(phpenv version-name)
- curl -sSfL -o ~/.phpenv/versions/$(phpenv version-name)/bin/phpunit https://phar.phpunit.de/phpunit-6.5.9.phar
- curl -sSfL -o ~/.phpenv/versions/$(phpenv version-name)/bin/phpunit https://phar.phpunit.de/phpunit-8.5.15.phar
- phpunit --version
- phpunit --configuration phpunit.xml
- phpunit --configuration phpunit.xml --coverage-clover build/logs/clover.xml

after_script:
- travis_retry php vendor/bin/php-coveralls -v
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -36,7 +36,7 @@ ArgParser::parse(array $args = null, array $required =[], array $defaults = []);
### [01] Parse command line

```php
use Stk2k\ArgParser\ArgParser;
use stk2k\argparser\ArgParser;

$args = ArgParser::parse(); // script.php a b -c --favorite-food="Fried potato"
print_r($args);
Expand All @@ -52,7 +52,7 @@ print_r($args);

## Requirement

PHP 7.1 or later
PHP 7.2 or later

## Installing stk2k/argparser

Expand Down
11 changes: 8 additions & 3 deletions composer.json
Expand Up @@ -12,15 +12,20 @@
}
],
"require": {
"php": ">=7.1"
"php": ">=7.2"
},
"require-dev": {
"phpunit/phpunit": "^6.3.0",
"phpunit/phpunit": "^8.5.15",
"php-coveralls/php-coveralls": "^2.0"
},
"autoload": {
"psr-4": {
"Stk2k\\ArgParser\\": "src/"
"stk2k\\argparser\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"stk2k\\argparser\\test\\": "test/"
}
}
}
4 changes: 2 additions & 2 deletions demo/01_parse_command_line.php
@@ -1,9 +1,9 @@
<?php
declare(strict_types=1);

require_once __DIR__ . '/include/autoload.php';
require_once dirname(__DIR__) . '/vendor/autoload.php';

use Stk2k\ArgParser\ArgParser;
use stk2k\argparser\ArgParser;

try{
$args = ArgParser::parse();
Expand Down
13 changes: 0 additions & 13 deletions demo/include/autoload.php

This file was deleted.

4 changes: 2 additions & 2 deletions phpunit.xml
Expand Up @@ -15,7 +15,7 @@
stopOnIncomplete="false"
stopOnSkipped="false"
stopOnRisky="false"
bootstrap="test/bootstrap.php"
bootstrap="vendor/autoload.php"
>
<testsuites>
<testsuite name="stk2k/argparser Tests">
Expand All @@ -27,7 +27,7 @@
<whitelist>
<directory suffix=".php">./src</directory>
<exclude>
<directory>./sample</directory>
<directory>./test</directory>
<directory>./vendor</directory>
<directory suffix="Interface.php">./src</directory>
</exclude>
Expand Down
2 changes: 1 addition & 1 deletion src/ArgParser.php
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace Stk2k\ArgParser;
namespace stk2k\argparser;

use InvalidArgumentException;

Expand Down
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace Stk2k\ArgParser\Exception;
namespace stk2k\argparser\exception;

use Exception;
use Throwable;
Expand Down
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace Stk2k\ArgParser\Exception;
namespace stk2k\argparser\exception;

final class OptionValueRequiredException extends ArgParserException
{
Expand Down
6 changes: 4 additions & 2 deletions test/ArgParserTest.php
@@ -1,8 +1,10 @@
<?php
namespace Calgamo\Getopt;
declare(strict_types=1);

namespace stk2k\argparser\test;

use PHPUnit\Framework\TestCase;
use Stk2k\ArgParser\ArgParser;
use stk2k\argparser\ArgParser;

class ArgParserTest extends TestCase
{
Expand Down
20 changes: 0 additions & 20 deletions test/bootstrap.php

This file was deleted.

36 changes: 0 additions & 36 deletions test/phpunit_test.xml

This file was deleted.

0 comments on commit 3deaf25

Please sign in to comment.