Skip to content

Commit

Permalink
Merge pull request #9 from kafkiansky/5.x
Browse files Browse the repository at this point in the history
5.x
  • Loading branch information
kafkiansky authored Jun 24, 2024
2 parents f4d2a4c + 52c1062 commit b7a8cc7
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ LICENSE.md export-ignore
tests export-ignore
phpunit.xml export-ignore
.scrutinizer.yml export-ignore
codeception.yml export-ignore
codeception.yml export-ignore
phpcs.xml export-ignore
psalm.xml export-ignore
2 changes: 1 addition & 1 deletion .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [8.1, 8.2 ]
php: [8.2, 8.3]
os: [ubuntu-latest]
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [8.1, 8.2]
php: [8.2, 8.3]
os: [ubuntu-latest]
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [8.1]
php: [8.2, 8.3]
stability: [prefer-lowest, prefer-stable]

name: PHP ${{ matrix.php }} / ${{ matrix.stability }}
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,20 @@ Install this package with Composer:
<code>composer require kafkiansky/service-locator-interrupter "^4.0" --dev</code>
</td>
</tr>
<tr>
<td>
<b>PHP ^8.2 && Laravel ^11.x</b>
</td>
<td>
<code>composer require kafkiansky/service-locator-interrupter "^5.0" --dev</code>
</td>
</tr>
</tbody>
</table>

## WHY
Laravel-like developers prefer to use some kinds of ioc bad practices.
In example: facades, helpers method, container injection and container instances creation anywhere: controllers, services, routes and even in models (wtf?).
In example: facades, helpers method, container injection and container instances creation anywhere: controllers, services, routes and even in models.
You need inject necessary services in method and constructor, not call container to do it for you.
Any services **must has** it own contract, container injection - it's not legal contract, it's hack.

Expand Down
9 changes: 7 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
"description": "Psalm plugin for Laravel that interrupt service locator calls.",
"license": "MIT",
"type": "psalm-plugin",
"keywords": [
"laravel",
"psalm",
"plugin"
],
"authors": [
{
"name": "v.zanfir",
Expand All @@ -11,13 +16,13 @@
}
],
"require": {
"php": "^8.1",
"php": "^8.2",
"ext-simplexml": "*",
"vimeo/psalm": "^5.12"
},
"require-dev": {
"ergebnis/composer-normalize": "^2.31",
"laravel/framework": "^10.13",
"laravel/framework": "^11.0",
"phpunit/phpunit": "^10.2",
"squizlabs/php_codesniffer": "^3.7",
"weirdan/codeception-psalm-module": "^0.14.0"
Expand Down

0 comments on commit b7a8cc7

Please sign in to comment.