Download the PHP package shopwelllabs/phpstan-shopwell without Composer

On this page you can find all versions of the php package shopwelllabs/phpstan-shopwell. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package phpstan-shopwell

PHPStan Rules for Shopwell 6

Latest Version on Packagist Total Downloads License

This package provides additional PHPStan rules for Shopwell 6 projects. It helps developers catch common mistakes and enforce best practices specific to Shopwell development.

Installation

You can install the package via composer:

Usage

To use these rules, include the package's configuration file in your PHPStan configuration:

or you use PHPStan Extension Installer

Experimental future compatibility (opt-in)

This experimental ruleset validates an extension against announced Shopwell BC changes as well as the installed version. Its checks and configuration may change as we expand the next-major compatibility analysis. Include it separately to opt in:

It reports calls and extensions incompatible with next-major declarations announced by Shopwell's BC-change attributes. This includes references to old class names retained as aliases after a class move. This ruleset is intentionally separate from rules.neon: adopting it means choosing to prepare for the next major while remaining compatible with the current one.

Features

Available Rules

Here's a comprehensive list of all available rules:

  1. NoSuperglobalsRule: Prevents usage of superglobals ($_GET, $_POST, $_FILES, $_REQUEST). Use proper request objects instead.

  2. DisallowFunctionsRule: Prevents usage of certain disallowed functions in the codebase.

  3. NoEntityRepositoryInLoopRule: Prevents EntityRepository method calls within loops to avoid N+1 query problems.

  4. NoSessionInPaymentHandlerAndStoreApiRule: Prevents usage of session in payment handlers and Store API contexts.

  5. NoSymfonySessionInConstructorRule: Prevents injection of Symfony Session in constructor to avoid early session starts.

  6. ForbidGlobBraceRule: Prevents usage of glob brace expansion for better cross-platform compatibility.

  7. InternalClassExtendsRule: Ensures proper extension of internal classes.

  8. NoUserEntityGetStoreTokenRule: Prevents direct access to store tokens from User entities.

  9. MethodBecomesAbstractRule: Checks for methods that should be abstract.

  10. ClassExtendUsesAbstractClassWhenExisting: Enforces the use of abstract classes when they exist.

  11. NoDALFilterByID: Prevents direct ID filtering in DAL queries.

  12. ScheduledTaskTooLowIntervalRule: Ensures scheduled tasks don't have too low intervals.

  13. DisallowDefaultContextCreation: Prevents creation of default contexts in inappropriate places.

  14. SetForeignKeyRule: Enforces proper foreign key handling.

  15. InternalFunctionCallRule: Controls usage of internal functions.

  16. InternalMethodCallRule: Controls usage of internal methods.

  17. DisallowSessionFunctionsRule: Prevents usage of session functions (session_write_close, session_start, session_destroy). Use the Symfony Session component instead.

  18. ForbidLocalDiskWriteRule: Prevents local disk write operations (file_put_contents, fopen with write mode, mkdir, unlink, etc.). Use the temporary directory or Flysystem instead.

  19. ForwardSalesChannelContextToSystemConfigServiceRule: Ensures that when a method has a SalesChannelContext parameter, it is forwarded to SystemConfigService methods as the salesChannelId argument.

  20. ForbidPredictableSaltRule: Prevents hardcoded salts in crypt() and password_hash() calls, which are predictable and weaken security.

  21. ForbidWeakCryptoKeyRule: Prevents weak cryptographic key sizes in openssl_pkey_new() calls. RSA keys must be at least 2048 bits.

  22. ForbidInsecureCookieRule: Prevents setting cookies without the secure flag in setcookie() and setrawcookie() calls. Cookies should use secure=true for HTTPS-only transmission.

  23. ForbidInsecureSymfonyCookieRule: Prevents creating Symfony Cookie objects without explicit secure=true. Detects new Cookie(...), Cookie::create(...), and ->withSecure(false) calls. The $secure parameter must be explicitly set to true for HTTPS-only transmission.

  24. ForbidDisabledSslVerificationRule: Prevents disabling SSL/TLS certificate verification in curl_setopt() and stream_context_create() calls, which allows man-in-the-middle attacks.

  25. NoEmptyResponseRule: Detects Response class/subclass instantiations with empty or missing body content. Checks classes where the first constructor parameter represents the response body (e.g. Response, JsonResponse, JsonApiResponse) and allows empty bodies for status codes like 204, 301, 302, 304, 307, and 308.

Configuration

You can customize the behavior of these rules by adding configuration to your phpstan.neon file. See the configuration section for more details.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.

License

Licensed under the Apache License 2.0. See NOTICE for the preserved upstream MIT license.


All versions of phpstan-shopwell with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
phpstan/phpstan Version ^2
symfony/polyfill-php84 Version ^1.31
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package shopwelllabs/phpstan-shopwell contains the following files

Loading the files please wait ...