diff --git a/.gitattributes b/.gitattributes index 789106a..cdcc774 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8,4 +8,3 @@ phpstan.neon export-ignore phpunit.xml.dist export-ignore docs/ export-ignore tests/ export-ignore -stubs/ export-ignore diff --git a/.github/workflows/integrate.yml b/.github/workflows/integrate.yml index acc29c6..b846750 100644 --- a/.github/workflows/integrate.yml +++ b/.github/workflows/integrate.yml @@ -9,7 +9,7 @@ on: pull_request: null env: - PHP_EXTENSIONS: "intl" + PHP_EXTENSIONS: "intl, :php-psr" jobs: file_consistency: @@ -19,7 +19,7 @@ jobs: - name: "Set up PHP" uses: "shivammathur/setup-php@v2" with: - php-version: "8.0" + php-version: "8.1" extensions: "${{ env.PHP_EXTENSIONS }}" ini-values: "post_max_size=256M" @@ -60,9 +60,9 @@ jobs: strategy: matrix: php-version: - - "8.0" - "8.1" - "8.2" + - "8.3" steps: - name: "Set up PHP" uses: "shivammathur/setup-php@v2" @@ -101,7 +101,7 @@ jobs: - name: "Set up PHP" uses: "shivammathur/setup-php@v2" with: - php-version: "8.0" + php-version: "8.1" extensions: "${{ env.PHP_EXTENSIONS }}" ini-values: "post_max_size=256M" diff --git a/CHANGELOG.md b/CHANGELOG.md index 36373d9..1eecec1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## v0.1.8 (2024-04-29) +* Made PHP8.1 minimum version +* Updated dependency list +* Fixed Veneer stubs in gitattributes + ## v0.1.7 (2023-10-30) * Removed default composer license value * Refactored package file structure diff --git a/composer.json b/composer.json index c9b094e..557e5ae 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "email": "tom@inflatablecookie.com" } ], "require": { - "php": "^8.0", + "php": "^8.1", "decodelabs/atlas": "^0.10.5|^0.11", "decodelabs/coercion": "^0.2.6", @@ -19,8 +19,7 @@ "decodelabs/veneer": "^0.10.14" }, "require-dev": { - "decodelabs/glitch": "^0.18.5", - "decodelabs/terminus": "^0.9.4|^0.10", + "decodelabs/terminus": "^0.10", "decodelabs/phpstan-decodelabs": "^0.6.2" }, "autoload": { diff --git a/ecs.php b/ecs.php index 56f5fea..b904391 100644 --- a/ecs.php +++ b/ecs.php @@ -5,9 +5,12 @@ declare(strict_types=1); use Symplify\EasyCodingStandard\Config\ECSConfig; -use Symplify\EasyCodingStandard\ValueObject\Set\SetList; -return static function (ECSConfig $ecsConfig): void { - $ecsConfig->paths([__DIR__.'/src']); - $ecsConfig->sets([SetList::CLEAN_CODE, SetList::PSR_12]); -}; +return ECSConfig::configure() + ->withPaths([ + __DIR__ . '/src' + ]) + ->withPreparedSets( + cleanCode: true, + psr12: true + ); diff --git a/src/Context.php b/src/Context.php index f914430..1db6c71 100644 --- a/src/Context.php +++ b/src/Context.php @@ -46,8 +46,9 @@ class Context protected ?Session $session = null; - public function __construct(?Dir $runDir = null) - { + public function __construct( + ?Dir $runDir = null + ) { if (!$runDir) { if (false === ($dir = getcwd())) { throw Exceptional::Runtime('Unable to get current working directory'); @@ -121,8 +122,9 @@ public function getLocalManifest(): Manifest * * @return $this; */ - public function setPhpBinary(?string $bin): static - { + public function setPhpBinary( + ?string $bin + ): static { $this->phpBinary = $bin; return $this; } @@ -155,8 +157,9 @@ public function getPhpBinary(): string * * @return $this */ - public function setSession(Session $session): static - { + public function setSession( + Session $session + ): static { $this->session = $session; return $this; } @@ -176,8 +179,9 @@ public function getSession(): ?Session * * @return $this; */ - public function forceLocal(bool $force = true): static - { + public function forceLocal( + bool $force = true + ): static { $this->forceLocal = $force; return $this; } @@ -195,8 +199,9 @@ public function isForcedLocal(): bool * * @return $this; */ - public function setCiMode(bool $mode): static - { + public function setCiMode( + bool $mode + ): static { $this->ciMode = $mode; return $this; } @@ -256,8 +261,9 @@ public function runGlobal( * @param array $args * @return array */ - protected function reorderArguments(array $args): array - { + protected function reorderArguments( + array $args + ): array { static $find = [ '--no-interaction', '--no-plugins', @@ -301,8 +307,9 @@ protected function reorderArguments(array $args): array /** * Has script */ - public function hasScript(string $name): bool - { + public function hasScript( + string $name + ): bool { return $this->getLocalManifest()->hasScript($name); } @@ -331,8 +338,9 @@ public function runScript( /** * Has bin */ - public function hasBin(string $name): bool - { + public function hasBin( + string $name + ): bool { return false === strpos($name, '/') && $this->rootDir->getFile('vendor/bin/' . $name)->exists(); @@ -470,8 +478,9 @@ public function preparePackageInstallName( /** * Has package */ - public function hasPackage(string $package): bool - { + public function hasPackage( + string $package + ): bool { $manifest = $this->getLocalManifest(); return $manifest->hasPackage($package); } diff --git a/src/Manifest.php b/src/Manifest.php index c0794cf..83201bd 100644 --- a/src/Manifest.php +++ b/src/Manifest.php @@ -29,8 +29,9 @@ class Manifest */ protected Tree $data; - public function __construct(File $file) - { + public function __construct( + File $file + ) { $this->file = $file; $this->reload(); } @@ -59,8 +60,9 @@ public function reload(): void * * @return Tree */ - public function __get(string $name): Tree - { + public function __get( + string $name + ): Tree { return $this->data->{$name}; } @@ -219,8 +221,9 @@ public function getRequiredDevPackages(): array /** * Has package in either list */ - public function hasPackage(string $package): bool - { + public function hasPackage( + string $package + ): bool { return isset($this->data->require->{$package}) || isset($this->data->{'require-dev'}->{$package}); @@ -265,8 +268,9 @@ public function getRequiredExtensions(): array /** * Get package version */ - public function getPackageVersion(string $package): ?string - { + public function getPackageVersion( + string $package + ): ?string { return $this->data->require[$package] ?? $this->data->{'require-dev'}[$package]; @@ -307,8 +311,9 @@ public function getProvidedPackages(): array * * @return array */ - protected function getPackageMap(string $dataKey): array - { + protected function getPackageMap( + string $dataKey + ): array { $output = []; foreach ($this->data->{$dataKey} as $key => $node) { @@ -422,8 +427,9 @@ public function getScripts(): array /** * Has script */ - public function hasScript(string $name): bool - { + public function hasScript( + string $name + ): bool { return isset($this->data->scripts->{$name}); }