PHPackages                             adorade/prestashop-php-stubs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. adorade/prestashop-php-stubs

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

adorade/prestashop-php-stubs
============================

PrestaShop function and class declaration stubs for static analysis.

v8.2.4(3mo ago)031MITShellPHP ^8.1CI passing

Since Mar 15Pushed 3mo agoCompare

[ Source](https://github.com/adorade/prestashop-php-stubs)[ Packagist](https://packagist.org/packages/adorade/prestashop-php-stubs)[ Docs](https://github.com/adorade/prestashop-php-stubs)[ RSS](/packages/adorade-prestashop-php-stubs/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

PrestaShop PHP Stubs
====================

[](#prestashop-php-stubs)

This package provides stub declarations for [PrestaShop](https://www.prestashop-project.org)functions, classes and interfaces. These stubs can help plugin and theme developers leverage IDE completion and static analysis tools like [PHPStan](http://phpstan.org).

The stubs are generated directly from the source using [php-stubs/generator](https://github.com/php-stubs/generator).

Installation
------------

[](#installation)

Require this package as a development dependency with [Composer](https://getcomposer.org).

```
composer require --dev adorade/prestashop-php-stubs
```

Purpose
-------

[](#purpose)

Automates the generation of PHP stub files for **PrestaShop 8+** versions by downloading releases, cleaning unnecessary files, generating stubs, and committing them to version-specific Git branches.

Key Functions
-------------

[](#key-functions)

**prestashop\_dl**: Downloads and unpacks PrestaShop release ZIP files from GitHub for a specified version.

**clean\_prestashop**: Removes non-essential files (tools, var, non-English language files, documentation, examples, fonts, and non-PHP files) to reduce the codebase to only what's needed for stub generation.

**process**: Generates PHP stubs using the `generate-stubs` command with caching based on file checksums to avoid regenerating stubs for unchanged files.

**Main workflow**:

1. Fetches all PrestaShop version tags from GitHub API
2. Filters for PrestaShop 8+ versions
3. For each version: switches to corresponding branch, downloads/processes files, generates stubs
4. Creates class aliases for Core classes in `class_stubs.php` and controllers in `controllers_stubs.php`
5. Commits changes and tags the version if there are modifications

Technical Details
-----------------

[](#technical-details)

- Uses checksum-based caching in `.cache/` to avoid redundant stub generation
- Organizes cache by checksum prefix (first 4 characters split into 2-char directories)
- Filters empty stubs and marks them as ignored
- Automatically removes cache items that haven't been accessed in 30 days
- Sorts versions naturally and processes them sequentially

Running the script manually
---------------------------

[](#running-the-script-manually)

To generate the stubs, you need to execute the `scripts/create-stub.sh` script.

```
./scripts/create-stub.sh
# or specific version
./scripts/create-stub.sh --version 8.0.0
# or change cache cleanup period
./scripts/create-stub.sh --clean-cache 15
```

Usage in PHPStan
----------------

[](#usage-in-phpstan)

Include stubs in PHPStan configuration file.

```
parameters:
  scanDirectories:
    - vendor/adorade/prestashop-php-stubs/stubs/
```

Usage with VSCode PHP Intelephense extension
--------------------------------------------

[](#usage-with-vscode-php-intelephense-extension)

```
"intelephense.environment.includePaths": [
  "vendor/adorade/prestashop-php-stubs/stubs",
]
```

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance81

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

102d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7a740798f6375d1fbc7d1df369646e3bd06fd55d0438dedce1539654953e3472?d=identicon)[adorade](/maintainers/adorade)

---

Top Contributors

[![adorade](https://avatars.githubusercontent.com/u/6474149?v=4)](https://github.com/adorade "adorade (1 commits)")

### Embed Badge

![Health badge](/badges/adorade-prestashop-php-stubs/health.svg)

```
[![Health](https://phpackages.com/badges/adorade-prestashop-php-stubs/health.svg)](https://phpackages.com/packages/adorade-prestashop-php-stubs)
```

###  Alternatives

[spatie/laravel-dashboard

A dashboard for Laravel

574166.1k96](/packages/spatie-laravel-dashboard)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
