Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: overtrue/phplint
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 9.5.2
Choose a base ref
...
head repository: overtrue/phplint
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 14 commits
  • 26 files changed
  • 1 contributor

Commits on Oct 11, 2024

  1. fix issue #214

    llaville committed Oct 11, 2024
    Copy the full SHA
    ad28d0f View commit details
  2. prepare bugfix release 9.5.3

    llaville committed Oct 11, 2024
    Copy the full SHA
    584063a View commit details

Commits on Oct 31, 2024

  1. Copy the full SHA
    45f80e6 View commit details
  2. add PHP 8.4 on CI

    llaville committed Oct 31, 2024
    Copy the full SHA
    b01a2ac View commit details
  3. Copy the full SHA
    50b4077 View commit details
  4. Copy the full SHA
    e39a262 View commit details
  5. Copy the full SHA
    0c8b519 View commit details
  6. include output unit tests

    llaville committed Oct 31, 2024
    Copy the full SHA
    50bf33e View commit details

Commits on Nov 1, 2024

  1. prepare release 9.5.4

    llaville committed Nov 1, 2024
    Copy the full SHA
    7999b43 View commit details

Commits on Dec 7, 2024

  1. Copy the full SHA
    f46df2e View commit details
  2. Copy the full SHA
    f07f64d View commit details
  3. upgrade release workflow to use Box Manifest v4.1.2 (by default) to b…

    …uild PHAR distrib with manifests
    llaville committed Dec 7, 2024
    Copy the full SHA
    375a85d View commit details
  4. update release workflow by raising BOX Manifest min version constrain…

    …t (waiting new release that will fix issue llaville/box-manifest#17)
    llaville committed Dec 7, 2024
    Copy the full SHA
    7631fac View commit details

Commits on Dec 8, 2024

  1. prepare maintenance release 9.5.5

    llaville committed Dec 8, 2024
    Copy the full SHA
    c074e6a View commit details
8 changes: 8 additions & 0 deletions .changes/9.5.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

## 9.5.3 - 2024-10-11

### Fixed

- [#214](https://github.com/overtrue/phplint/issues/214) : junit invalid xml

**Full Changelog**: [9.5.2...9.5.3](https://github.com/overtrue/phplint/compare/9.5.2...9.5.3)
20 changes: 20 additions & 0 deletions .changes/9.5.4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

## 9.5.4 - 2024-11-01

> [!WARNING]
>
> Only versions 9.5.x or greater are now actively supported.
>
> Versions `9.1`, `9.2`, `9.3`, and `9.4` won't receive any updates as they reach end-of-life.
### Changed

Drop PHPUnit 10 support and upgrade to PHPUnit 11

- [#216](https://github.com/overtrue/phplint/issues/216) : PHPUnit 11 support

### Fixed

- [#215](https://github.com/overtrue/phplint/issues/215) : PHP 8.4 runtime support

**Full Changelog**: [9.5.3...9.5.4](https://github.com/overtrue/phplint/compare/9.5.3...9.5.4)
8 changes: 8 additions & 0 deletions .changes/9.5.5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

## 9.5.5 - 2024-12-08

### Changed

- upgrade SARIF output to support [PhpLintConverter](https://llaville.github.io/sarif-php-converters/1.0/converter/phplint/) of `bartlett/sarif-php-converters` package

**Full Changelog**: [9.5.4...9.5.5](https://github.com/overtrue/phplint/compare/9.5.4...9.5.5)
5 changes: 3 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@ jobs:
php-version:
- "8.2"
- "8.3"
- "8.4"

steps:
- # https://github.com/actions/checkout
@@ -40,6 +41,6 @@ jobs:
with:
composer-options: "--prefer-dist --no-scripts"

- # https://github.com/sebastianbergmann/phpunit/tree/10.5
name: Unit tests with PHPUnit 10
- # https://github.com/sebastianbergmann/phpunit/tree/11.4
name: Unit tests with PHPUnit 11
run: vendor/bin/phpunit --no-progress --testdox --do-not-cache-result
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@ jobs:
- # https://github.com/llaville/box-manifest
name: Download BOX Manifest Artifact
env:
BOX_MANIFEST_VERSION: "4.0.0"
BOX_MANIFEST_VERSION: ${{ vars.BOX_MANIFEST_VERSION || '4.1.3' }}
run: |
curl -Ls "https://github.com/llaville/box-manifest/releases/download/$BOX_MANIFEST_VERSION/box-manifest.phar" -o /usr/local/bin/box-manifest
chmod +x /usr/local/bin/box-manifest
50 changes: 43 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -7,15 +7,51 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
and is generated by [Changie](https://github.com/miniscruff/changie).

## 9.5.5 - 2024-12-08

### Changed

- upgrade SARIF output to support [PhpLintConverter](https://llaville.github.io/sarif-php-converters/1.0/converter/phplint/) of `bartlett/sarif-php-converters` package

**Full Changelog**: [9.5.4...9.5.5](https://github.com/overtrue/phplint/compare/9.5.4...9.5.5)

## 9.5.4 - 2024-11-01

> [!WARNING]
>
> Only versions 9.5.x or greater are now actively supported.
>
> Versions `9.1`, `9.2`, `9.3`, and `9.4` won't receive any updates as they reach end-of-life.
### Changed

Drop PHPUnit 10 support and upgrade to PHPUnit 11

- [#216](https://github.com/overtrue/phplint/issues/216) : PHPUnit 11 support

### Fixed

- [#215](https://github.com/overtrue/phplint/issues/215) : PHP 8.4 runtime support

**Full Changelog**: [9.5.3...9.5.4](https://github.com/overtrue/phplint/compare/9.5.3...9.5.4)

## 9.5.3 - 2024-10-11

### Fixed

- [#214](https://github.com/overtrue/phplint/issues/214) : junit invalid xml

**Full Changelog**: [9.5.2...9.5.3](https://github.com/overtrue/phplint/compare/9.5.2...9.5.3)

## 9.5.2 - 2024-10-08

Same as 9.5.0 (except for GitHub Workflows that still used PHP 8.1)
Same as 9.5.0 (except for GitHub Workflows that still used PHP 8.1)

**Full Changelog**: [9.5.0...9.5.2](https://github.com/overtrue/phplint/compare/9.5.0...9.5.2)

## 9.5.1 - 2024-10-08

Same as 9.5.0 (except for GitHub Workflows that still used PHP 8.1)
Same as 9.5.0 (except for GitHub Workflows that still used PHP 8.1)

**Full Changelog**: [9.5.0...9.5.1](https://github.com/overtrue/phplint/compare/9.5.0...9.5.1)

@@ -35,10 +71,10 @@ Same as 9.5.0 (except for GitHub Workflows that still used PHP 8.1)
## 9.4.1 - 2024-07-05

> [!NOTE]
>
>
> This bugfix version is only for the PHAR distribution.
### Fixed
### Fixed

- [#210](https://github.com/overtrue/phplint/issues/210) : PHAR manifest is broken

@@ -63,11 +99,11 @@ Same as 9.5.0 (except for GitHub Workflows that still used PHP 8.1)
### Removed

- legacy `log-*` and `sarif-converter` options
- useless help column in configuration table when verbose mode is active
- useless help column in configuration table when verbose mode is active

### Fixed
### Fixed

- shortcut of `progress` option is now detected on `phplint` binary launcher.
- shortcut of `progress` option is now detected on `phplint` binary launcher.

**Full Changelog**: [9.3.1...9.4.0](https://github.com/overtrue/phplint/compare/9.3.1...9.4.0)

18 changes: 14 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -3,9 +3,19 @@ ARG PHP_VERSION=8.3

FROM php:${PHP_VERSION}-cli-alpine

ARG PACKAGE_CONSTRAINT=9.5.x-dev

# https://github.com/opencontainers/image-spec/blob/main/annotations.md

LABEL org.opencontainers.image.title="overtrue/phplint"
LABEL org.opencontainers.image.description="Docker image of overtrue/phplint Composer package"
LABEL org.opencontainers.image.source="https://github.com/overtrue/phplint"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.authors="overtrue,llaville"

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
RUN cp /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini
RUN chmod +x /entrypoint.sh \
&& cp /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini

# Default container directory where to mount your project source files
# GitLab uses $CI_PROJECT_DIR to identify where job runs on source files
@@ -18,10 +28,10 @@ RUN addgroup appgroup && adduser appuser -D -G appgroup
# Tell docker that all future commands should run as the appuser user
USER appuser

# Install Composer v2 then overtrue/phplint package
# Install Composer v2 binary then package
COPY --from=composer/composer:2-bin /composer /usr/bin/composer
ENV COMPOSER_ALLOW_SUPERUSER 1
RUN composer global require --no-progress overtrue/phplint 9.5.x-dev
RUN composer global require --no-progress overtrue/phplint $PACKAGE_CONSTRAINT

# Following recommendation at https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#workdir

26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -10,19 +10,19 @@
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fovertrue%2Fphplint.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fovertrue%2Fphplint?ref=badge_shield)


| Version | Status | Requirements |
|:--------|:------------------------------------------|:---------------|
| **9.x** | **Active development** | **PHP >= 8.1** |
| 9.5 | Active support | PHP >= 8.2 |
| 9.4 | Active support | PHP >= 8.1 |
| 9.3 | Active support | PHP >= 8.1 |
| 9.2 | Active support | PHP >= 8.1 |
| 9.1 | Active support | PHP >= 8.1 |
| 9.0 | End Of Life | PHP >= 8.0 |
| 6.x | End Of Life | PHP >= 8.2 |
| 5.x | End Of Life | PHP >= 8.1 |
| 4.x | End Of Life | PHP >= 8.0 |
| 3.x | End Of Life | PHP >= 7.4 |
| Version | Status | Requirements |
|:--------|:-----------------------|:---------------|
| **9.x** | **Active development** | **PHP >= 8.2** |
| 9.5 | Active support | PHP >= 8.2 |
| 9.4 | End Of Life | PHP >= 8.1 |
| 9.3 | End Of Life | PHP >= 8.1 |
| 9.2 | End Of Life | PHP >= 8.1 |
| 9.1 | End Of Life | PHP >= 8.1 |
| 9.0 | End Of Life | PHP >= 8.0 |
| 6.x | End Of Life | PHP >= 8.2 |
| 5.x | End Of Life | PHP >= 8.1 |
| 4.x | End Of Life | PHP >= 8.0 |
| 3.x | End Of Life | PHP >= 7.4 |

**NOTE** if you have an older version of PHP lower than 8.0, we recommend to use the latest version [3.4.0](https://github.com/overtrue/phplint/releases/tag/3.4.0)

4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -81,7 +81,7 @@
"cghooks": "vendor/bin/cghooks",
"style:check": "vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --using-cache=no --verbose --ansi --diff --dry-run",
"style:fix": "vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --using-cache=no --verbose --ansi",
"tests:unit": "vendor/bin/phpunit --testsuite=cache,configuration,finder",
"tests:unit": "vendor/bin/phpunit --testsuite=cache,configuration,finder,output",
"tests:e2e": "vendor/bin/phpunit --testsuite=e2e",
"tests:all": "vendor/bin/phpunit",
"lint:syntax": "./bin/phplint --ansi",
@@ -92,7 +92,7 @@
"scripts-descriptions": {
"style:check": "Run style checks (only dry run - no fixing!).",
"style:fix": "Run style checks and fix violations.",
"tests:unit": "Run unit tests on following components: cache, configuration, finder",
"tests:unit": "Run unit tests on following components: cache, configuration, finder, output",
"tests:e2e": "Run end to end tests",
"tests:all": "Run unit and end to end tests",
"lint:syntax": "Run PHPLint on it own source code",
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@

| Version | Status | Requirements |
|:--------|:------------------------------------------|:---------------|
| **9.x** | **Active development** | **PHP >= 8.0** |
| **9.x** | **Active development** | **PHP >= 8.2** |
| 6.x | End Of Life | PHP >= 8.2 |
| 5.x | End Of Life | PHP >= 8.1 |
| 4.x | End Of Life | PHP >= 8.0 |
6 changes: 5 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd"
bootstrap="autoload.php"
executionOrder="depends,defects"
beStrictAboutOutputDuringTests="true"
failOnRisky="true"
failOnWarning="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
colors="true"
cacheDirectory=".phpunit.cache"
requireCoverageMetadata="true"
@@ -24,6 +25,9 @@
<testsuite name="finder">
<directory>tests/Finder</directory>
</testsuite>
<testsuite name="output">
<directory>tests/Output</directory>
</testsuite>
</testsuites>
<coverage/>
<source>
2 changes: 1 addition & 1 deletion src/Cache.php
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ final class Cache
private int $hits = 0;
private int $misses = 0;

public function __construct(string|object $cachePoolAdapter = null)
public function __construct(string|object|null $cachePoolAdapter = null)
{
if (null === $cachePoolAdapter) {
$adapter = new ArrayAdapter();
2 changes: 1 addition & 1 deletion src/Console/Application.php
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ public function __construct()
parent::__construct(self::NAME, self::getPrettyVersion());
}

public function run(InputInterface $input = null, OutputInterface $output = null): int
public function run(?InputInterface $input = null, ?OutputInterface $output = null): int
{
$output ??= new ConsoleOutput(STDOUT);

2 changes: 1 addition & 1 deletion src/Event/EventDispatcher.php
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ public function __construct(iterable $extensions)
}
}

public function dispatch(object $event, string $eventName = null): object
public function dispatch(object $event, ?string $eventName = null): object
{
$triggered = false;

4 changes: 2 additions & 2 deletions src/Helper/ProcessHelper.php
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ public function getName(): string
public function start(
OutputInterface $output,
Process $process,
callable $callback = null,
?callable $callback = null,
array $env = [],
int $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE
): Process {
@@ -97,7 +97,7 @@ private function wrapCallback(
DebugFormatterHelper $formatter,
OutputInterface $output,
Process $process,
callable $callback = null
?callable $callback = null
): callable {
return function ($type, $buffer) use ($output, $process, $callback, $formatter) {
$output->write(
2 changes: 1 addition & 1 deletion src/Output/JunitOutput.php
Original file line number Diff line number Diff line change
@@ -66,6 +66,6 @@ public function format(LinterOutput $results): void
$error->setAttribute('message', $value['error']);
}

$this->write($document->saveXML());
$this->write($document->saveXML(), false, self::OUTPUT_RAW);
}
}
8 changes: 7 additions & 1 deletion src/Output/SarifOutput.php
Original file line number Diff line number Diff line change
@@ -20,6 +20,8 @@
use Symfony\Component\Console\Formatter\OutputFormatterInterface;
use Symfony\Component\Console\Output\StreamOutput;

use function class_exists;
use function dirname;
use function ob_get_clean;
use function ob_start;

@@ -38,8 +40,12 @@ public function __construct(
?OutputFormatterInterface $formatter = null,
?ConverterInterface $converter = null
) {
if (!class_exists(PhpLintConverter::class)) {
// use default Composer-Bin-Plugin autoloader to load Sarif-Php-Converters components
require_once dirname(__DIR__, 2) . '/vendor-bin/sarif/vendor/autoload.php';
}
parent::__construct($stream, $verbosity, $decorated, $formatter);
$this->converter = $converter ?? new PhpLintConverter(null, $this->isVerbose());
$this->converter = $converter ?? new PhpLintConverter(['format_output' => $this->isVerbose()]);
}

public function getName(): string
6 changes: 3 additions & 3 deletions src/Process/LintProcess.php
Original file line number Diff line number Diff line change
@@ -40,8 +40,8 @@ final class LintProcess extends Process

public function __construct(
array $command,
string $cwd = null,
array $env = null,
?string $cwd = null,
?array $env = null,
mixed $input = null,
?float $timeout = 60
) {
@@ -158,7 +158,7 @@ public function getItem(SplFileInfo $fileInfo): LintProcessItem
return (self::$createLintProcessItem)($hasError, $errorString, $errorLine, $hasWarning, $warningString, $warningLine, $fileInfo);
}

public function begin(callable $callback = null, array $env = []): void
public function begin(?callable $callback = null, array $env = []): void
{
if ($this->helper instanceof ProcessHelper) {
$this->helper->start($this->output, $this, $callback, $env);
Loading