{"id":19041867,"url":"https://github.com/allure-framework/allure-php-commons2","last_synced_at":"2025-04-23T22:21:02.912Z","repository":{"id":37867902,"uuid":"400159590","full_name":"allure-framework/allure-php-commons2","owner":"allure-framework","description":"Allure integrations for PHP test frameworks: Commons Module","archived":false,"fork":false,"pushed_at":"2025-04-11T10:33:03.000Z","size":154,"stargazers_count":8,"open_issues_count":3,"forks_count":5,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-11T12:03:13.740Z","etag":null,"topics":["allure","php","reporting"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/allure-framework.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-08-26T12:24:15.000Z","updated_at":"2025-04-11T10:33:06.000Z","dependencies_parsed_at":"2023-12-15T20:08:16.974Z","dependency_job_id":"831000a9-372b-4703-838d-b838f49b4aad","html_url":"https://github.com/allure-framework/allure-php-commons2","commit_stats":{"total_commits":46,"total_committers":4,"mean_commits":11.5,"dds":0.4565217391304348,"last_synced_commit":"8efbe8d20e686a83bb684b0ec333a5d549f39efc"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allure-framework%2Fallure-php-commons2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allure-framework%2Fallure-php-commons2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allure-framework%2Fallure-php-commons2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allure-framework%2Fallure-php-commons2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/allure-framework","download_url":"https://codeload.github.com/allure-framework/allure-php-commons2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248418119,"owners_count":21100190,"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":["allure","php","reporting"],"created_at":"2024-11-08T22:32:57.449Z","updated_at":"2025-04-23T22:21:02.889Z","avatar_url":"https://github.com/allure-framework.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Allure PHP Commons\n\n[![Version](http://poser.pugx.org/allure-framework/allure-php-commons/version)](https://packagist.org/packages/allure-framework/allure-php-commons)\n[![Build](https://github.com/allure-framework/allure-php-commons2/actions/workflows/build.yml/badge.svg)](https://github.com/allure-framework/allure-php-commons2/actions/workflows/build.yml)\n[![Type Coverage](https://shepherd.dev/github/allure-framework/allure-php-commons2/coverage.svg)](https://shepherd.dev/github/allure-framework/allure-php-commons2)\n[![Psalm Level](https://shepherd.dev/github/allure-framework/allure-php-commons2/level.svg)](https://shepherd.dev/github/allure-framework/allure-php-commons2)\n[![License](http://poser.pugx.org/allure-framework/allure-php-commons/license)](https://packagist.org/packages/allure-framework/allure-php-commons)\n\nThis repository contains PHP API for Allure framework. The main idea is to reuse this API when creating adapters for different test frameworks.\n\n## Getting started\nIn order to use this API you simply need to add the following to **composer.json**:\n```json\n{\n    \"require\": {\n        \"php\": \"^8\",\n        \"allure-framework/allure-php-commons\": \"^2\"\n    }\n}\n```\n\n## Custom attributes\nYou can easily implement custom attributes and use them with your test framework. In most cases you would like\nto implement [`Qameta\\Allure\\Attribute\\AttributeSetInterface`](./src/Attribute/AttributeSetInterface.php) that allows to set several attributes at once:\n\n```php\n\u003c?php\n\nuse Qameta\\Allure\\Attribute\\AttributeSetInterface;\nuse Qameta\\Allure\\Attribute\\DisplayName;\nuse Qameta\\Allure\\Attribute\\Tag;\n\n#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD)]\nclass MyAttribute implements AttributeSetInterface\n{\n    private array $tags;\n\n    public function __construct(\n        private string $displayName,\n        string ...$tags,\n    ) {\n        $this-\u003etags = $tags;\n    }\n    \n    public function getAttributes() : array\n    {\n        return [\n            new DisplayName($this-\u003edisplayName),\n            ...array_map(\n                fn (string $tag): Tag =\u003e new Tag($tag),\n                $this-\u003etags,\n            ),\n        ];\n    }\n}\n\n// Example of usage\n#[MyAttribute('Test name', 'tag 1', 'tag 2')]\nclass MyTestClass\n{\n}\n```\n\nYou can also implement particular attribute interfaces instead of using one of the standard implementations:\n\n- [`Qameta\\Allure\\Attribute\\DescriptionInterface`](./src/Attribute/DescriptionInterface.php)\n- [`Qameta\\Allure\\Attribute\\DisplayNameInterface`](./src/Attribute/DisplayNameInterface.php)\n- [`Qameta\\Allure\\Attribute\\LabelInterface`](./src/Attribute/LabelInterface.php)\n- [`Qameta\\Allure\\Attribute\\LinkInterface`](./src/Attribute/LinkInterface.php)\n- [`Qameta\\Allure\\Attribute\\ParameterInterface`](./src/Attribute/ParameterInterface.php)\n\n## Other usage examples\nSee [allure-phpunit](https://github.com/allure-framework/allure-phpunit)\nand [allure-codeception](https://github.com/allure-framework/allure-codeception) projects.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallure-framework%2Fallure-php-commons2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallure-framework%2Fallure-php-commons2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallure-framework%2Fallure-php-commons2/lists"}