Skip to content

Commit

Permalink
Merge pull request #7 from kafkiansky/v4.x
Browse files Browse the repository at this point in the history
Bump dependencies, fix psalm issues, add new tracked helpers
  • Loading branch information
kafkiansky authored Jun 23, 2023
2 parents 150f5eb + c80704f commit f4d2a4c
Show file tree
Hide file tree
Showing 24 changed files with 1,236 additions and 255 deletions.
4 changes: 1 addition & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@ LICENSE.md export-ignore
tests export-ignore
phpunit.xml export-ignore
.scrutinizer.yml export-ignore
codeception.yml export-ignore
docker export-ignore
docker-compose.yml export-ignore
codeception.yml export-ignore
30 changes: 30 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: security

on:
push:
pull_request:

jobs:
security:
name: Security
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
php: [8.1, 8.2 ]
os: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: Install Dependencies
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --prefer-dist --no-interaction --no-progress
- name: Security Advisories
run: composer require --dev roave/security-advisories:dev-latest
31 changes: 31 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: static-analysis

on:
push:
pull_request:

jobs:
psalm:
name: Psalm
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
php: [8.1, 8.2]
os: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: Install Dependencies
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --prefer-dist --no-interaction --no-progress
- name: Static Analysis
continue-on-error: true
run: vendor/bin/psalm --no-cache
12 changes: 2 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ on:
push:
branches:
- master
- develop
pull_request:
branches:
- develop
- master

jobs:
Expand All @@ -17,7 +15,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [7.4, 8.0, 8.1]
php: [8.1]
stability: [prefer-lowest, prefer-stable]

name: PHP ${{ matrix.php }} / ${{ matrix.stability }}
Expand Down Expand Up @@ -46,10 +44,4 @@ jobs:
run: composer validate

- name: Execute tests
run: composer test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
run: composer test
15 changes: 0 additions & 15 deletions .scrutinizer.yml

This file was deleted.

10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ Install this package with Composer:
<code>composer require kafkiansky/service-locator-interrupter "2.1.0" --dev</code>
</td>
</tr>
<tr>
<td>
<b>PHP ^8.1 && Laravel ^10.x</b>
</td>
<td>
<code>composer require kafkiansky/service-locator-interrupter "^4.0" --dev</code>
</td>
</tr>
</tbody>
</table>

Expand Down Expand Up @@ -268,7 +276,7 @@ This plugin can found issues of service locator usage - helpers, facades, contai
## Testing

``` bash
$ composer test
$ composer codeception
```

## License
Expand Down
2 changes: 1 addition & 1 deletion codeception.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace: Psalm\PhpUnitPlugin\Tests
namespace: Kafkiansky\ServiceLocatorInterrupter\Tests

paths:
tests: tests/acceptance
Expand Down
109 changes: 59 additions & 50 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,53 +1,62 @@
{
"name": "kafkiansky/service-locator-interrupter",
"description": "Psalm plugin for Laravel that interrupt service locator calls.",
"license": "MIT",
"type": "psalm-plugin",
"authors": [
{
"name": "Vadim Zanfir",
"email": "[email protected]"
}
],
"autoload": {
"psr-4": {
"Kafkiansky\\ServiceLocatorInterrupter\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Kafkiansky\\ServiceLocatorInterrupter\\Tests\\": "tests"
}
},
"require": {
"php": ">=7.4 || <= 8.1",
"ext-simplexml": "*",
"vimeo/psalm": ">= 4.0"
},
"require-dev": {
"laravel/framework": "^7.0 || ^8.0",
"phpunit/phpunit": "^9.5",
"weirdan/codeception-psalm-module": "^0.13.0"
},
"config": {
"sort-packages": true,
"process-timeout": 0,
"allow-plugins": {
"composer/package-versions-deprecated": true
}
},
"extra": {
"psalm": {
"pluginClass": "Kafkiansky\\ServiceLocatorInterrupter\\Plugin"
}
},
"scripts": {
"test": [
"@codeception"
"name": "kafkiansky/service-locator-interrupter",
"description": "Psalm plugin for Laravel that interrupt service locator calls.",
"license": "MIT",
"type": "psalm-plugin",
"authors": [
{
"name": "v.zanfir",
"email": "[email protected]",
"role": "maintainer"
}
],
"codeception": [
"codecept build",
"codecept run -v -g laravel-interrupter"
]
}
"require": {
"php": "^8.1",
"ext-simplexml": "*",
"vimeo/psalm": "^5.12"
},
"require-dev": {
"ergebnis/composer-normalize": "^2.31",
"laravel/framework": "^10.13",
"phpunit/phpunit": "^10.2",
"squizlabs/php_codesniffer": "^3.7",
"weirdan/codeception-psalm-module": "^0.14.0"
},
"autoload": {
"psr-4": {
"Kafkiansky\\ServiceLocatorInterrupter\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Kafkiansky\\ServiceLocatorInterrupter\\Tests\\": "tests"
}
},
"config": {
"allow-plugins": {
"composer/package-versions-deprecated": true,
"ergebnis/composer-normalize": true
},
"process-timeout": 0,
"sort-packages": true
},
"extra": {
"psalm": {
"pluginClass": "Kafkiansky\\ServiceLocatorInterrupter\\Plugin"
}
},
"scripts": {
"codeception": [
"codecept build",
"codecept run -v -g laravel-interrupter"
],
"phpcbf": "./vendor/bin/phpcbf -p --standard=phpcs.xml src",
"phpcs": "./vendor/bin/phpcs --standard=phpcs.xml",
"psalm": "./vendor/bin/psalm --no-cache",
"test": [
"@codeception",
"@psalm",
"@phpcs"
]
}
}
10 changes: 0 additions & 10 deletions docker-compose.yml

This file was deleted.

15 changes: 0 additions & 15 deletions docker/Dockerfile

This file was deleted.

40 changes: 40 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Code Style Ruleset">
<rule ref="PSR12">
<exclude name="PSR12.Classes.AnonClassDeclaration"/>
<exclude name="Generic.Files.LineLength"/>
<exclude name="PSR12.Files.FileHeader.SpacingAfterBlock"/>
</rule>
<rule ref="Generic.PHP.ForbiddenFunctions">
<properties>
<property name="forbiddenFunctions" type="array" extend="true">
<element key="join" value="implode" />
<element key="chop" value="rtrim" />
<element key="strchr" value="strstr" />
<element key="show_source" value="highlight_file" />
<element key="ini_alter" value="ini_set" />
<element key="dns_check_record" value="checkdnsrr" />
<element key="dns_get_mx" value="getmxrr" />
<element key="doubleval" value="floatval" />
<element key="is_long" value="is_int" />
<element key="is_integer" value="is_int" />
<element key="is_double" value="is_float" />
<element key="is_real" value="is_float" />
<element key="fputs" value="fwrite" />
<element key="set_file_buffer" value="stream_set_write_buffer" />
<element key="set_socket_blocking" value="stream_set_blocking" />
<element key="socket_set_blocking" value="stream_set_blocking" />
<element key="stream_register_wrapper" value="stream_wrapper_register" />
<element key="socket_set_timeout" value="stream_set_timeout" />
<element key="socket_get_status" value="stream_get_meta_data" />
<element key="is_writeable" value="is_writable" />
<element key="pos" value="current" />
<element key="sizeof" value="count" />
</property>
</properties>
</rule>
<arg name="colors"/>
<file>./src</file>
<exclude-pattern type="relative">*/tests/*</exclude-pattern>
<exclude-pattern type="relative">*/vendor/*</exclude-pattern>
</ruleset>
3 changes: 0 additions & 3 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,4 @@
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-clover" target="clover.xml"/>
</logging>
</phpunit>
17 changes: 17 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<psalm
errorLevel="1"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
findUnusedBaselineEntry="true"
findUnusedCode="true"
>
<projectFiles>
<directory name="src" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
</psalm>
Loading

0 comments on commit f4d2a4c

Please sign in to comment.