{"id":15023733,"url":"https://github.com/sebsept/ps_dev_base","last_synced_at":"2026-02-04T06:30:17.469Z","repository":{"id":50954193,"uuid":"312205567","full_name":"SebSept/ps_dev_base","owner":"SebSept","description":"Code analysis toolset for Prestashop module development without configuration pain.","archived":true,"fork":false,"pushed_at":"2022-11-04T16:01:27.000Z","size":123,"stargazers_count":9,"open_issues_count":12,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-05T16:03:16.360Z","etag":null,"topics":["autoindex","composer","php-cs-fixer","phpstan","prestashop","prestashop-dev","prestashop-standards"],"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/SebSept.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"sebsept","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-11-12T07:55:08.000Z","updated_at":"2024-12-05T14:08:04.000Z","dependencies_parsed_at":"2023-01-21T14:04:52.778Z","dependency_job_id":null,"html_url":"https://github.com/SebSept/ps_dev_base","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SebSept%2Fps_dev_base","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SebSept%2Fps_dev_base/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SebSept%2Fps_dev_base/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SebSept%2Fps_dev_base/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SebSept","download_url":"https://codeload.github.com/SebSept/ps_dev_base/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239792129,"owners_count":19697884,"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":["autoindex","composer","php-cs-fixer","phpstan","prestashop","prestashop-dev","prestashop-standards"],"created_at":"2024-09-24T19:59:23.250Z","updated_at":"2026-02-04T06:30:17.440Z","avatar_url":"https://github.com/SebSept.png","language":"PHP","funding_links":["https://ko-fi.com/sebsept"],"categories":[],"sub_categories":[],"readme":"# Prestashop Dev Base\n\nThis package provides **tools for [Prestashop](https://github.com/prestashop/prestashop) module development**.  \nIt's made to **remove the burden of intallation and configuration of essential development tools**. \n\n![code quality](https://github.com/SebSept/ps_dev_base/actions/workflows/phpstan_and_style.yml/badge.svg)\n\nQuik start : \n```shell\ncomposer require --dev sebsept/ps_dev_base\ncomposer list psdt\n```\n\n\n## Requirements \n\n- Have composer 2 installed (not composer 1.x). If you do not have composer, it's time to [start learning it](https://getcomposer.org/).\n- Your module must require php \u003e= 7.2.5\n\nFor easier use, I highly suggest to use command line autocompletion for composer.  \nThere's a couple options available, [this one](https://github.com/bamarni/symfony-console-autocomplete) is [recommanded by composer](https://getcomposer.org/doc/03-cli.md#command-line-completion).\n\n## Featured tools\n\n- Code formating : [php-cs-fixer](https://github.com/FriendsOfPhp/PHP-CS-Fixer) configured using prestashop standard, ready to use out of the box.\n- Code analysis : [phpstan](https://phpstan.org/) autodetect PrestaShop root directory or  asks (nothing more to do). \n- `fill-indexes` command, to add required index.php files. (see below for details)\n- git pre-commit hook installer (details below)\n\nMore tools will come ...\n\n## How does it work ?\n\nThis package is composer plugin, it adds new commmands to composer command line tool.  \nThese commands are under the namespace `psdt` (PrestaShop Developement Tools).\n\nThe first time a command is run, a composer script is also added.\nFor example, the php-cs-fixer can be invoked with `composer psdt:php-cs-fixer`.  \nYou can even take an additionnal step by [defining an alias](https://duckduckgo.com/?q=linux+alias\u0026t=github\u0026ia=web).\n\n## Provided commands\n\n* [psdt:php-cs-fixer](#fill-indexes)\n* [psdt:phpstan](#phpstan)\n* [psdt:fill-indexes](#fill-indexes)\n* [psdt:pre-commit](#git-pre-commit-hook-installer) (not supported on Windows yet)\n\n### php-cs-fixer\n\n`composer psdt:php-cs-fixer [--reconfigure]`\n\nFormats php files for complying with the Prestashop standards.\nThis allows consistent code base.\n\nProvided by [PrestaShop/php-dev-tools/](https://github.com/PrestaShop/php-dev-tools/).  \nAutoinstallation provided by this package.\n\nAllows complying with the [Prestashop standards](https://devdocs.prestashop.com/1.7/development/coding-standards/).\n\nOn the first run (or when `--reconfigure` option is used):\n* the _PrestaShop/php-dev-tools_ package will be installed if needed.\n* _.php_cs_ file will be (re)created with the Prestashop standard styles. (Destructive operation, get your files under version control!)\n* the composer script _php-cs-fixer_ will be added. So you can invoke this command with `composer php-cs-fixer`\n\nThe next runs will run the fixer. All files will be formated according to the Prestashop standard.\n\n### phpstan\n\n`composer psdt:phpstan [--reconfigure]`\n\nRun phpstan configured with  [Prestashop standards](https://devdocs.prestashop.com/1.7/development/coding-standards/) against a PrestaShop installation.\n\nProvided by [PrestaShop/php-dev-tools/](https://github.com/PrestaShop/php-dev-tools/).  \nAutoinstallation provided by this package.\n\nThe first run or `composer psdt:phpstan --reconfigure` do : \n  - package `prestashop/prestashop-dev-tools` will be installed (if needed)\n  - creates/overrides the phpstan.neon configuration with Prestashop standards.\n  - guess the \\_PS_ROOT_DIR_ and asks for confirmation (or you can provide another path) (this path is needed for analyse)\n  - install a composer script `phpstan`\n\nThe next runs will trigger `composer psdt:phpstan`\n\n### fill-indexes\n\n`composer psdt:fill-indexes [--check-only]`\n\nAdd the missing index.php files on each folder.\nExisting index.php files are not overriden.\n\n`--check-only` option only list the missing index.php files without adding them.  \nThis option is usefull for running in the git's pre-commit hook.\n\nThis is a security requirement of Prestashop to avoid the contents to be listed.\n\nMore information [on the official documentation](https://devdocs.prestashop.com/1.7/modules/sell/techvalidation-checklist/#a-file-indexphp-exists-in-each-folder).\n\nI can't include [prestashop/autoindex](https://github.com/PrestaShopCorp/autoindex) because [it targets php 5.6](https://github.com/PrestaShopCorp/autoindex/blob/92e10242f94a99163dece280f6bd7b7c2b79c158/composer.json#L23) and has other issues.  \nMy replacement is simpler and doesn't require additionnal dependencies.\n\n### Git Pre-commit hook installer\n\n`composer psdt:pre-commit [--reconfigure]`\n\n- `precommit.sh` file is added\n- symlink it to `.git/hooks/pre-commit` is created\n- symlink is made executable\n- composer script `pre-commit` is added\n\nBefore a commit is performed the composer script `pre-commit` will be triggered and must succeed (return 0), otherwise the commit is aborted.\n\nThe commands in composer `pre-commit` script hook are provided by command implementing the `PreCommitRegistrableCommand` interface.  \nThis is currently `phpstan`, `php-cs-fixer` and `fill-indexes`\n\nYou can tweak the script by just editing the composer script.  \nYou can run the `composer psdt:pre-commit` (or `composer run-script pre-commit`) to predict if commit will fail or not. \n\n## Installation\n\n`composer require --dev sebsept/ps_dev_base`\n\n## Under the hood / Credits\n\n[php-cs-fixer](https://github.com/FriendsOfPhp/PHP-CS-Fixer) and [phpstan](https://phpstan.org/) configuration and bootstraping are provided by [PrestaShop/php-dev-tools/](https://github.com/PrestaShop/php-dev-tools/).  \nRepository actions are made by [github workflows](https://docs.github.com/en/free-pro-team@latest/actions).\n\n## What's next ?\n\nSee is issues in this GitHub repository.\n\n## Development notes (for this package)\n\nInstall the precommit hook with `ln -s $(pwd)/precommit.sh .git/hooks/pre-commit` (works on linux).\nEnsure to also make the file executable `chmod +x precommit.sh`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebsept%2Fps_dev_base","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsebsept%2Fps_dev_base","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebsept%2Fps_dev_base/lists"}