Skip to content

Commit

Permalink
Merge branch 'release/v0.1.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
betterthanclay committed Apr 29, 2024
2 parents 0aedd2f + 783ea17 commit 899fa41
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 43 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ phpstan.neon export-ignore
phpunit.xml.dist export-ignore
docs/ export-ignore
tests/ export-ignore
stubs/ export-ignore
8 changes: 4 additions & 4 deletions .github/workflows/integrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
pull_request: null

env:
PHP_EXTENSIONS: "intl"
PHP_EXTENSIONS: "intl, :php-psr"

jobs:
file_consistency:
Expand All @@ -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"

Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"

Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"email": "[email protected]"
} ],
"require": {
"php": "^8.0",
"php": "^8.1",

"decodelabs/atlas": "^0.10.5|^0.11",
"decodelabs/coercion": "^0.2.6",
Expand All @@ -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": {
Expand Down
13 changes: 8 additions & 5 deletions ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
45 changes: 27 additions & 18 deletions src/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand Down Expand Up @@ -256,8 +261,9 @@ public function runGlobal(
* @param array<string> $args
* @return array<string>
*/
protected function reorderArguments(array $args): array
{
protected function reorderArguments(
array $args
): array {
static $find = [
'--no-interaction',
'--no-plugins',
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
}
Expand Down
30 changes: 18 additions & 12 deletions src/Manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ class Manifest
*/
protected Tree $data;

public function __construct(File $file)
{
public function __construct(
File $file
) {
$this->file = $file;
$this->reload();
}
Expand Down Expand Up @@ -59,8 +60,9 @@ public function reload(): void
*
* @return Tree<string|int|float|null>
*/
public function __get(string $name): Tree
{
public function __get(
string $name
): Tree {
return $this->data->{$name};
}

Expand Down Expand Up @@ -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});
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -307,8 +311,9 @@ public function getProvidedPackages(): array
*
* @return array<string, Package>
*/
protected function getPackageMap(string $dataKey): array
{
protected function getPackageMap(
string $dataKey
): array {
$output = [];

foreach ($this->data->{$dataKey} as $key => $node) {
Expand Down Expand Up @@ -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});
}

Expand Down

0 comments on commit 899fa41

Please sign in to comment.