Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 16, 2024 via composer

phpcompatibility/php-compatibility 9.3.5

A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.
Package summary
Share
3
issues
2
high severity
meta
2
1
moderate severity
license
1
2
licenses
1
LGPL-3.0-or-later
1
BSD-3-Clause
Package created
16 Jul 2018
Version published
27 Dec 2019
Maintainers
2
Total deps
2
Direct deps
1
License
LGPL-3.0-or-later

Issues

3

2 high severity issues

high
via: phpcompatibility/php-compatibility@9.3.5
via: phpcompatibility/php-compatibility@9.3.5
Collapse
Expand

1 moderate severity issue

moderate
Recommendation: Validate that the package complies with your license policy
via: phpcompatibility/php-compatibility@9.3.5
Collapse
Expand

Install Script Usage

β“˜ This section contains AI-generated explanations for this package's install scripts.

The "post-install-cmd" Script

"vendor/bin/phpcs" --config-set installed_paths ../../..

This script is used to configure PHP_CodeSniffer (phpcs). The command sets the installed_paths configuration option for PHP_CodeSniffer, which specifies the location of the coding standard directories. It does not have any known security vulnerabilities nor does it have the potential to cause direct harm. This operation seems to be purely configuration-based.

The "post-update-cmd" Script

"vendor/bin/phpcs" --config-set installed_paths ../../..

This script changes the configuration settings for PHP CodeSniffer (phpcs) by setting the installed_paths setting value to ../../.. which refers to the parent directory. This is simply adjusting the tool's configuration and doesn't run or download any remote code, nor does it expose any sensitive information.

Licenses

GNU Lesser General Public License v3.0 or later

Weakly Protective
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
use-patent-claims
Cannot
sublicense
hold-liable
Must
include-original
state-changes
disclose-source
include-license
include-copyright
include-install-instructions
1 Packages, Including:
phpcompatibility/php-compatibility@9.3.5

BSD 3-Clause "New" or "Revised" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
use-trademark
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
squizlabs/php_codesniffer@3.9.2
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of phpcompatibility/php-compatibility 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
squizlabs/php_codesniffer3.9.2-BSD-3-Clause
prod

Visualizations

Frequently Asked Questions

What does phpcompatibility/php-compatibility do?

The PHPCompatibility package is a set of sniffing codes designed to work with PHP_CodeSniffer, a popular tool to detect violations of coding standards in PHP. Its main role is to check for PHP cross-version compatibility, allowing you to analyze your web project for compatibility issues with lower and higher versions of PHP. With it, you can locate features that are either deprecated or removed in specific versions of PHP, as well as detect the use of new PHP features that may break compatibility with older servers. Hence, it's a vital tool for maintaining interoperability across varied hosting environments, which is crucial for wide-scale PHP applications or libraries.

How do you use phpcompatibility/php-compatibility?

To use PHPCompatibility inside your projects, you will need Composer, the standard dependency manager for PHP. You start by adding the package to your composer.json file, in the require-dev section:

{
    "require-dev": {
        "phpcompatibility/php-compatibility": "*"
    },
    "prefer-stable": true
}

Next, inform PHP CodeSniffer about the location of this package:

{
    "scripts": {
        "post-install-cmd": "\"vendor/bin/phpcs\" --config-set installed_paths vendor/phpcompatibility/php-compatibility",
        "post-update-cmd" : "\"vendor/bin/phpcs\" --config-set installed_paths vendor/phpcompatibility/php-compatibility"
    }
}

Finally, install PHPCompatibility using Composer:

$ composer update --lock

You can then verify if this PHP standard is correctly registered by typing ./vendor/bin/phpcs -i in your command-line interface. PHPCompatibility should appear in the list of available standards. Running the compatibility checks can be done by pointing PHP CodeSniffer to PHPCompatibility, like so:

$ ./vendor/bin/phpcs -p . --standard=PHPCompatibility

If you wish to target specific PHP versions or ranges, add the --runtime-set testVersion XX flag, where XX represents the PHP versions you want to check compatibility with:

$ ./vendor/bin/phpcs -p . --standard=PHPCompatibility --runtime-set testVersion 5.6-

In the last example, the codebase will be analyzed for compatibility issues with PHP 5.6 and above.

Where are the phpcompatibility/php-compatibility docs?

Detailed documentation for the PHPCompatibility package can be found in the README.md of its official GitHub repository. This document contains extensive information on how to install and use the package, information about PHP version support, plus tips on reading the generated reports.