Skip to content

Commit

Permalink
Merge pull request #8 from sourcetoad/wake-up
Browse files Browse the repository at this point in the history
Code Style & Tests
  • Loading branch information
iBotPeaches authored Apr 24, 2020
2 parents 60451f5 + 3ec5ed4 commit 19300aa
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 37 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: main
on:
push:
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [7.2, 7.3, 7.4]
stability: [prefer-lowest, prefer-stable]
name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, gd, soap
coverage: none

- name: Install dependencies
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-suggest

- name: Execute tests
run: vendor/bin/phpunit --verbose
code_styles:
runs-on: ubuntu-latest
name: Code Style
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
key: dependencies-php-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.2'
coverage: none

- name: Install dependencies
run: composer install --no-suggest --prefer-dist -n -o

- name: Run style check
id: style_check
run: vendor/bin/phpcs
13 changes: 0 additions & 13 deletions Dockerfile

This file was deleted.

19 changes: 0 additions & 19 deletions Jenkinsfile

This file was deleted.

5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@
"php": ">=7.2.0",
"ext-soap": "*",
"ext-simplexml": "*",
"illuminate/support": "^6.0"
"illuminate/support": "^6.0|^7.0"
},
"require-dev": {
"orchestra/testbench": "^4.0"
"orchestra/testbench": "^3.8|^4.0|^5.0",
"squizlabs/php_codesniffer": "^3.5"
},
"autoload": {
"psr-4": {
Expand Down
9 changes: 9 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="PHP_CodeSniffer">
<file>./src</file>
<file>./tests</file>

<exclude-pattern>*/vendor/*</exclude-pattern>

<rule ref="PSR2" />
</ruleset>
4 changes: 2 additions & 2 deletions src/SoapyCurtain.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function setCache(int $cache): self
$allowed = [WSDL_CACHE_NONE, WSDL_CACHE_DISK, WSDL_CACHE_MEMORY, WSDL_CACHE_BOTH];

if (! in_array($cache, $allowed)) {
throw new \InvalidArgumentException('Cache value passed (' . $allowed . ') is not valid. Allowed (WSDL_CACHE_*)');
throw new \InvalidArgumentException('Cache value passed (' . $allowed . ') is not valid.');
}

$this->cache = $cache;
Expand Down Expand Up @@ -154,7 +154,7 @@ public function setLocation(string $location): self

public function addTypeMapViaClassName(string $namespace, string $item, string $itemClass)
{
$function = function(string $xml) use ($itemClass) {
$function = function (string $xml) use ($itemClass) {
$object = simplexml_load_string($xml);
return new $itemClass($object);
};
Expand Down
2 changes: 1 addition & 1 deletion src/SoapyServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function boot()

public function register()
{
$this->app->singleton(SoapyTub::class, function() {
$this->app->singleton(SoapyTub::class, function () {
return new SoapyTub();
});
}
Expand Down

0 comments on commit 19300aa

Please sign in to comment.