This commit is contained in:
2025-02-04 12:40:43 +03:00
parent 4bcb4c60dd
commit 50343d5a87
372 changed files with 9019 additions and 6684 deletions

View File

@@ -2,12 +2,6 @@
All notable changes in `sebastianbergmann/environment` are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
## [8.0.0] - 2025-02-07
### Removed
* This component is no longer supported on PHP 8.2
## [7.2.0] - 2024-07-03
### Changed
@@ -215,7 +209,6 @@ All notable changes in `sebastianbergmann/environment` are documented in this fi
* This component is no longer supported on PHP 5.6
[8.0.0]: https://github.com/sebastianbergmann/environment/compare/7.2...main
[7.2.0]: https://github.com/sebastianbergmann/environment/compare/7.1.0...7.2.0
[7.1.0]: https://github.com/sebastianbergmann/environment/compare/7.0.0...7.1.0
[7.0.0]: https://github.com/sebastianbergmann/environment/compare/6.1...7.0.0

View File

@@ -1,6 +1,6 @@
BSD 3-Clause License
Copyright (c) 2014-2025, Sebastian Bergmann
Copyright (c) 2014-2024, Sebastian Bergmann
All rights reserved.
Redistribution and use in source and binary forms, with or without

View File

@@ -1,4 +1,4 @@
[![Latest Stable Version](https://poser.pugx.org/sebastian/environment/v)](https://packagist.org/packages/sebastian/environment)
[![Latest Stable Version](https://poser.pugx.org/sebastian/environment/v/stable.png)](https://packagist.org/packages/sebastian/environment)
[![CI Status](https://github.com/sebastianbergmann/environment/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/environment/actions)
[![codecov](https://codecov.io/gh/sebastianbergmann/environment/branch/main/graph/badge.svg)](https://codecov.io/gh/sebastianbergmann/environment)

View File

@@ -16,18 +16,17 @@
},
"config": {
"platform": {
"php": "8.3.0"
"php": "8.2.0"
},
"optimize-autoloader": true,
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=8.3"
"php": ">=8.2"
},
"require-dev": {
"phpunit/phpunit": "^12.0-dev"
"phpunit/phpunit": "^11.0"
},
"suggest": {
"ext-posix": "*"
@@ -39,7 +38,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "8.0-dev"
"dev-main": "7.2-dev"
}
}
}

View File

@@ -12,14 +12,12 @@ namespace SebastianBergmann\Environment;
use const DIRECTORY_SEPARATOR;
use const STDIN;
use const STDOUT;
use function assert;
use function defined;
use function fclose;
use function fstat;
use function function_exists;
use function getenv;
use function in_array;
use function is_array;
use function is_resource;
use function is_string;
use function posix_isatty;
@@ -38,17 +36,17 @@ final class Console
/**
* @var int
*/
public const int STDIN = 0;
public const STDIN = 0;
/**
* @var int
*/
public const int STDOUT = 1;
public const STDOUT = 1;
/**
* @var int
*/
public const int STDERR = 2;
public const STDERR = 2;
/**
* Returns true if STDOUT supports colorization.
@@ -184,10 +182,6 @@ final class Console
['suppress_errors' => true],
);
assert(is_array($pipes));
assert(isset($pipes[1]) && is_resource($pipes[1]));
assert(isset($pipes[2]) && is_resource($pipes[2]));
if (is_resource($process)) {
$info = stream_get_contents($pipes[1]);

View File

@@ -10,6 +10,7 @@
namespace SebastianBergmann\Environment;
use const PHP_BINARY;
use const PHP_MAJOR_VERSION;
use const PHP_SAPI;
use const PHP_VERSION;
use function array_map;
@@ -59,6 +60,10 @@ final class Runtime
*/
public function performsJustInTimeCompilation(): bool
{
if (PHP_MAJOR_VERSION < 8) {
return false;
}
if (!$this->isOpcacheActive()) {
return false;
}