{"id":18840614,"url":"https://github.com/bitexpert/phpstan-magento","last_synced_at":"2025-04-04T06:08:39.264Z","repository":{"id":38421037,"uuid":"176821265","full_name":"bitExpert/phpstan-magento","owner":"bitExpert","description":"Magento specific extension for PHPStan","archived":false,"fork":false,"pushed_at":"2024-05-14T04:05:59.000Z","size":840,"stargazers_count":131,"open_issues_count":8,"forks_count":25,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-05-16T01:37:37.478Z","etag":null,"topics":["magento2","php","phpstan","phpstan-extension"],"latest_commit_sha":null,"homepage":"","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/bitExpert.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"publiccode":null,"codemeta":null}},"created_at":"2019-03-20T21:39:40.000Z","updated_at":"2024-06-18T12:26:40.818Z","dependencies_parsed_at":"2024-01-11T20:47:22.436Z","dependency_job_id":"702fd00a-df1f-4688-a650-4a6d79950471","html_url":"https://github.com/bitExpert/phpstan-magento","commit_stats":{"total_commits":382,"total_committers":14,"mean_commits":"27.285714285714285","dds":"0.45811518324607325","last_synced_commit":"8f75225db0cbc55f47e5f24acfde03d377c799f8"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitExpert%2Fphpstan-magento","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitExpert%2Fphpstan-magento/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitExpert%2Fphpstan-magento/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitExpert%2Fphpstan-magento/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitExpert","download_url":"https://codeload.github.com/bitExpert/phpstan-magento/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247128751,"owners_count":20888235,"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":["magento2","php","phpstan","phpstan-extension"],"created_at":"2024-11-08T02:48:19.194Z","updated_at":"2025-04-04T06:08:39.247Z","avatar_url":"https://github.com/bitExpert.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bitexpert/phpstan-magento\n\nThis package provides some additional features for PHPStan to make it work for Magento 2 projects.\nYou can use this PHPStan extension for both Magento module projects and Magento application projects.\n\n[![Build Status](https://github.com/bitExpert/phpstan-magento/workflows/ci/badge.svg?branch=master)](https://github.com/bitExpert/phpstan-magento/actions)\n[![Coverage Status](https://coveralls.io/repos/github/bitExpert/phpstan-magento/badge.svg?branch=master)](https://coveralls.io/github/bitExpert/phpstan-magento?branch=master)\n[![installs on Packagist](https://img.shields.io/packagist/dt/bitExpert/phpstan-magento)](https://packagist.org/packages/bitExpert/phpstan-magento/)\n[![Mastodon Follow](https://img.shields.io/mastodon/follow/109408681246972700?domain=https://rheinneckar.social)](https://rheinneckar.social/@bitexpert)\n\n## Requirements\n\nPHP: PHP 7.2 or higher\n\nMagento: Magento 2.3.0 or higher\n\nPHPStan: PHPStan 2.0 or higher\n\nIf you are using a Magento version that requires an older version of PHPStan (e.g. 0.12.77),  you need to manually upgrade it before \ninstalling this extension. in your composer.json Change the PHPStan version to `~2.0` and run:\n\n```\ncomposer update phpstan/phpstan --with-all-dependencies\n```\n\nThis PHPStan extension needs to be registered with PHPStan so that the extension gets loaded properly. The easiest way to do this is \nto install the `phpstan/extension-installer` package as follows:\n\n```\ncomposer.phar require --dev phpstan/extension-installer\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eComposer Allow-Plugins configuration\u003c/summary\u003e\n\nIf you're using Composer \u003e= 2.2.0 you have to allow the execution of composer plugins ([see allow-plugins section](https://getcomposer.org/doc/06-config.md#allow-plugins)) as follows:\n\n```\n  - Installing phpstan/extension-installer (1.1.0): Extracting archive\nphpstan/extension-installer contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins\nDo you trust \"phpstan/extension-installer\" to execute code and wish to enable it now? (writes \"allow-plugins\" to composer.json) [y,n,d,?] y\n```\n\n\u003c/details\u003e\n\n## Installation\n\nThe preferred way of installing `bitexpert/phpstan-magento` is through Composer.\nYou can add `bitexpert/phpstan-magento` as a dev dependency, as follows:\n\n```\ncomposer.phar require --dev bitexpert/phpstan-magento\n```\n\n\u003e Want a full walk-through of the installation \u0026 configuration process? Read the blog post at M.academy about [Static Analysis in Magento with PHPStan](https://m.academy/blog/static-analysis-magento-phpstan/).\n\n### PHPStan configuration\n\nIf you have not already a PHPStan configuration file `phpstan.neon` in your project, create a new empty file next to your `composer.json` file.\n\nSee [here](https://phpstan.org/config-reference) what options PHPStan allows you to configure. \n\n## Feature overview\n\nThis PHPStan extension works for both Magento module projects and Magento application projects.\n\n- Class generator for factory \u0026 proxy classes\n- Mocked classes autoloader\n- TestFramework autoloader\n- Type hints\n  - TestFramework ObjectManager type hints\n  - ObjectManager type hints\n- Magic method calls\n- Extension attributes\n- PHPStan rules\n  - Service contracts\n  - Resource Models should be used directly\n  - Collections should be used directly via factory\n  - Do not use setTemplate in Block classes\n  \nFor a detailed overview, check the feature documentation [here](docs/features.md).\n\n## Contribute\n\nPlease feel free to fork and extend existing or add new features and send a pull request with your changes! To establish\na consistent code quality, please provide unit tests for all your changes and adapt the documentation.\n\n## Want To Contribute?\n\nIf you feel that you have something to share, then we’d love to have you.\nCheck out [the contributing guide](CONTRIBUTING.md) to find out how, as well as what we expect from you.\n\n## License\n\nPHPStan Magento Extension is released under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitexpert%2Fphpstan-magento","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitexpert%2Fphpstan-magento","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitexpert%2Fphpstan-magento/lists"}