{"id":18929563,"url":"https://github.com/thecodingmachine/service-provider-utils","last_synced_at":"2025-10-15T09:37:37.687Z","repository":{"id":57067905,"uuid":"56608553","full_name":"thecodingmachine/service-provider-utils","owner":"thecodingmachine","description":"This package contains a set of tools to work with container-interop's service-providers.","archived":false,"fork":false,"pushed_at":"2016-04-19T15:29:57.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":8,"default_branch":"1.0","last_synced_at":"2025-02-16T12:30:29.596Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thecodingmachine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-19T15:24:29.000Z","updated_at":"2017-01-15T15:27:55.000Z","dependencies_parsed_at":"2022-08-24T10:20:14.902Z","dependency_job_id":null,"html_url":"https://github.com/thecodingmachine/service-provider-utils","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fservice-provider-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fservice-provider-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fservice-provider-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fservice-provider-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thecodingmachine","download_url":"https://codeload.github.com/thecodingmachine/service-provider-utils/tar.gz/refs/heads/1.0","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239927825,"owners_count":19719835,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T11:33:38.202Z","updated_at":"2025-10-15T09:37:32.633Z","avatar_url":"https://github.com/thecodingmachine.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/thecodingmachine/service-provider-utils/badges/quality-score.png?b=1.0)](https://scrutinizer-ci.com/g/thecodingmachine/service-provider-utils/?branch=1.0)\n[![Build Status](https://travis-ci.org/thecodingmachine/service-provider-utils.svg?branch=1.0)](https://travis-ci.org/thecodingmachine/service-provider-utils)\n[![Coverage Status](https://coveralls.io/repos/thecodingmachine/service-provider-utils/badge.svg?branch=1.0\u0026service=github)](https://coveralls.io/github/thecodingmachine/service-provider-utils?branch=1.0)\n\n# Service-provider utils\n\nThis package contains a set of tools to work with [container-interop's service-providers](https://github.com/container-interop/definition-interop/).\n\n## Installation\n\nYou can install this package through Composer:\n\n```json\n{\n    \"require\": {\n        \"thecodingmachine/service-provider-utils\": \"~1.0\"\n    }\n}\n```\n\nThe packages adheres to the [SemVer](http://semver.org/) specification, and there will be full backward compatibility\nbetween minor versions.\n\n## Usage\n\nThis package contains a single utility method that analyses a factory (i.e. a callable) and returns if the second argument (the `$previous` argument) is used or not.\n\n```php\n// $previous is not used in this callable\n$callable = function(ContainerInterface $container, $previous) {\n    return new MyService();\n});\n\n$factoryAnalyser = new FactoryAnalyzer();\n$isPreviousUsed = $factoryAnalyser-\u003eisPreviousArgumentUsed($callable);\n// $isPreviousUsed === false\n```\n\nNote: this function can sometimes return false positives, in particular if your body contains calls to `func_get_args` or refences by variable name (`$$foo`). It should however never return false negatives.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodingmachine%2Fservice-provider-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecodingmachine%2Fservice-provider-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodingmachine%2Fservice-provider-utils/lists"}