Skip to content

Commit

Permalink
Add invoke method and property accessors (#4)
Browse files Browse the repository at this point in the history
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
  • Loading branch information
ghostwriter authored May 3, 2022
2 parents 6571183 + 6c608dd commit 674cdfd
Show file tree
Hide file tree
Showing 12 changed files with 573 additions and 1,222 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ $container->register(new TasksServiceProvider());
Registering a service extension on the container.

```php
$container->bind(GitHubClient::class);
$container->extend(GitHubClient::class, function (Container $container, object $client) {
$client->setEnterpriseUrl($client->get(GitHubClient::GITHUB_HOST));
});
Expand All @@ -110,6 +111,7 @@ class GitHubExtension implements ExtensionInterface
}
}

$container->bind(GitHubClient::class);
$container->add(GitHubClient::class, $container->get(GitHubExtention::class));
```

Expand Down
13 changes: 5 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"phpunit/phpunit": "^9.5",
"psalm/plugin-phpunit": "^0.16",
"rector/rector": "^0.12",
"roave/infection-static-analysis-plugin": "^1.18",
"roave/security-advisories": "dev-latest",
"symplify/easy-coding-standard": "^10.2",
"vimeo/psalm": "^4.23"
Expand All @@ -53,7 +52,10 @@
"autoload-dev": {
"psr-4": {
"Ghostwriter\\Container\\Tests\\": "tests/"
}
},
"files": [
"tests/Fixture/functions.php"
]
},
"config": {
"allow-plugins": {
Expand All @@ -77,7 +79,6 @@
"@test",
"@psalm",
"@rector:dry-run",
"@infection",
"@psalm:security"
],
"cs-check": "vendor/bin/ecs check --clear-cache || true",
Expand All @@ -88,10 +89,6 @@
"@psalm",
"@infection"
],
"infection": [
"@xdebug",
"roave-infection-static-analysis-plugin"
],
"missing-returntypes": "psalm --alter --issues=MissingReturnType",
"normalizer": "@composer normalize --no-check-lock",
"phpunit": "phpunit --colors=always --testdox --stop-on-failure",
Expand All @@ -100,7 +97,7 @@
"psalm:dry-run": "psalm --alter --issues=all --dry-run",
"psalm:missing": "psalm --alter --issues=MissingReturnType",
"psalm:security": "psalm --taint-analysis",
"psalm:shepherd": "psalm --shepherd --stats",
"psalm:shepherd": "psalm --shepherd --stats --no-diff --no-cache",
"rector": "vendor/bin/rector process",
"rector:dry-run": "vendor/bin/rector process --dry-run || true",
"test": [
Expand Down
Loading

0 comments on commit 674cdfd

Please sign in to comment.