Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ jobs:
- "8.3"
- "8.4"
- "8.5"
- "8.6"

steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v7

- name: Install PHP
uses: shivammathur/setup-php@v2
Expand All @@ -35,7 +36,7 @@ jobs:
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV

- name: Cache dependencies installed with composer
uses: actions/cache@v3
uses: actions/cache@v6
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
Expand All @@ -48,6 +49,6 @@ jobs:
run: vendor/bin/phpunit --colors=always --coverage-clover clover.xml

- name: Send code coverage report to Codecov.io
uses: codecov/codecov-action@v5
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
5 changes: 3 additions & 2 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ jobs:
- "8.3"
- "8.4"
- "8.5"
- "8.6"

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: Install PHP
uses: shivammathur/setup-php@v2
Expand All @@ -35,7 +36,7 @@ jobs:
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV

- name: Cache dependencies installed with composer
uses: actions/cache@v4
uses: actions/cache@v6
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ Documentation is available at: https://docs.dotkernel.org/dot-maker/.
[![GitHub stars](https://img.shields.io/github/stars/dotkernel/dot-maker)](https://github.com/dotkernel/dot-maker/stargazers)
[![GitHub license](https://img.shields.io/github/license/dotkernel/dot-maker)](https://github.com/dotkernel/dot-maker/blob/2.0/LICENSE)

[![Build Static](https://github.com/dotkernel/dot-maker/actions/workflows/continuous-integration.yml/badge.svg?branch=2.0)](https://github.com/dotkernel/dot-maker/actions/workflows/continuous-integration.yml)
[![Build Static](https://github.com/dotkernel/dot-maker/actions/workflows/continuous-integration.yml/badge.svg?branch=2.x)](https://github.com/dotkernel/dot-maker/actions/workflows/continuous-integration.yml)
[![codecov](https://codecov.io/gh/dotkernel/dot-maker/graph/badge.svg?token=KT9UA402B4)](https://codecov.io/gh/dotkernel/dot-maker)
[![PHPStan](https://github.com/dotkernel/dot-maker/actions/workflows/static-analysis.yml/badge.svg?branch=2.0)](https://github.com/dotkernel/dot-maker/actions/workflows/static-analysis.yml)
[![PHPStan](https://github.com/dotkernel/dot-maker/actions/workflows/static-analysis.yml/badge.svg?branch=2.x)](https://github.com/dotkernel/dot-maker/actions/workflows/static-analysis.yml)

## Installation

Expand Down
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,14 @@
}
},
"require": {
"php": "~8.3.0 || ~8.4.0 || ~8.5.0"
"php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0"
},
"require-dev": {
"boundwize/structarmed": "^0.19",
"laminas/laminas-coding-standard": "^3.1.0",
"mikey179/vfsstream": "^1.6.12",
"phpstan/phpstan": "^2.1.33",
"phpstan/phpstan-phpunit": "^2.0.10",
"phpunit/phpunit": "^10.5.60"
"phpunit/phpunit": "^12.5.22"
},
"scripts": {
"check": [
Expand Down
4 changes: 2 additions & 2 deletions docs/book/v2/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Programmatically generate Dotkernel project files and directories.
[![GitHub stars](https://img.shields.io/github/stars/dotkernel/dot-maker)](https://github.com/dotkernel/dot-maker/stargazers)
[![GitHub license](https://img.shields.io/github/license/dotkernel/dot-maker)](https://github.com/dotkernel/dot-maker/blob/2.0/LICENSE)

[![Build Static](https://github.com/dotkernel/dot-maker/actions/workflows/continuous-integration.yml/badge.svg?branch=2.0)](https://github.com/dotkernel/dot-maker/actions/workflows/continuous-integration.yml)
[![Build Static](https://github.com/dotkernel/dot-maker/actions/workflows/continuous-integration.yml/badge.svg?branch=2.x)](https://github.com/dotkernel/dot-maker/actions/workflows/continuous-integration.yml)
[![codecov](https://codecov.io/gh/dotkernel/dot-maker/graph/badge.svg?token=KT9UA402B4)](https://codecov.io/gh/dotkernel/dot-maker)
[![PHPStan](https://github.com/dotkernel/dot-maker/actions/workflows/static-analysis.yml/badge.svg?branch=2.0)](https://github.com/dotkernel/dot-maker/actions/workflows/static-analysis.yml)
[![PHPStan](https://github.com/dotkernel/dot-maker/actions/workflows/static-analysis.yml/badge.svg?branch=2.x)](https://github.com/dotkernel/dot-maker/actions/workflows/static-analysis.yml)

Make sure you run through our guides on using the [inputs](./io/input.md) and the [outputs](./io/output.md).

Expand Down
4 changes: 0 additions & 4 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,3 @@ parameters:
- src
- test
treatPhpDocTypesAsCertain: false
ignoreErrors:
-
message: '#Call to an undefined method org\\bovigo\\vfs\\vfsStreamContent::getChild\(\).#'
path: %currentWorkingDirectory%/test/FileSystem/FileTest.php
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/12.5/phpunit.xsd"
bootstrap="./vendor/autoload.php"
colors="true">
<testsuites>
Expand Down
6 changes: 3 additions & 3 deletions test/Component/CoreImportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Dot\Maker\Component\Import;
use Dot\Maker\Context;
use org\bovigo\vfs\vfsStream;
use DotTest\Maker\Fixture\TemporaryDirectory;
use PHPUnit\Framework\TestCase;

class CoreImportTest extends TestCase
Expand All @@ -15,7 +15,7 @@ class CoreImportTest extends TestCase

protected function setUp(): void
{
$root = vfsStream::setup('root', 0644, [
$root = TemporaryDirectory::create([
'composer.json' => '{
"autoload": {
"psr-4": {
Expand All @@ -26,7 +26,7 @@ protected function setUp(): void
}',
]);

$this->context = new Context($root->url());
$this->context = new Context($root);
}

public function testWillGetAbstractFormFqcn(): void
Expand Down
6 changes: 3 additions & 3 deletions test/Component/ImportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Dot\Maker\Component\Import;
use Dot\Maker\Context;
use org\bovigo\vfs\vfsStream;
use DotTest\Maker\Fixture\TemporaryDirectory;
use PHPUnit\Framework\TestCase;

class ImportTest extends TestCase
Expand All @@ -15,7 +15,7 @@ class ImportTest extends TestCase

protected function setUp(): void
{
$root = vfsStream::setup('root', 0644, [
$root = TemporaryDirectory::create([
'composer.json' => '{
"autoload": {
"psr-4": {
Expand All @@ -25,7 +25,7 @@ protected function setUp(): void
}',
]);

$this->context = new Context($root->url());
$this->context = new Context($root);
}

public function testWillGetAbstractFormFqcn(): void
Expand Down
8 changes: 4 additions & 4 deletions test/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace DotTest\Maker;

use Dot\Maker\Config;
use org\bovigo\vfs\vfsStream;
use DotTest\Maker\Fixture\TemporaryDirectory;
use PHPUnit\Framework\TestCase;

use function sprintf;
Expand All @@ -20,7 +20,7 @@ public function testWillInstantiateWithoutConfigFile(): void

public function testConfigFileWithoutMakerKeyWillThrowError(): void
{
$fileSystem = vfsStream::setup('root', 0644, [
$fileSystem = TemporaryDirectory::create([
'config' => [
'autoload' => [
'maker.local.php' => <<<CFG
Expand All @@ -35,9 +35,9 @@ public function testConfigFileWithoutMakerKeyWillThrowError(): void
]);

$this->expectExceptionMessage(
sprintf('%s/%s: key "Maker::class" not found', $fileSystem->url(), Config::CONFIG_FILE)
sprintf('%s/%s: key "Maker::class" not found', $fileSystem, Config::CONFIG_FILE)
);
$config = new Config($fileSystem->url());
$config = new Config($fileSystem);
$this->assertContainsOnlyInstancesOf(Config::class, [$config]);
}
}
48 changes: 24 additions & 24 deletions test/ContextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace DotTest\Maker;

use Dot\Maker\Context;
use org\bovigo\vfs\vfsStream;
use DotTest\Maker\Fixture\TemporaryDirectory;
use PHPUnit\Framework\TestCase;

use function sprintf;
Expand All @@ -22,39 +22,39 @@ public function testWillNotInstantiateWithoutComposerJson(): void

public function testWillNotInstantiateWithInvalidComposerJson(): void
{
$fileSystem = vfsStream::setup('root', 0644, [
$fileSystem = TemporaryDirectory::create([
'composer.json' => '',
]);
$this->expectExceptionMessage(sprintf('%s/composer.json: invalid JSON', $fileSystem->url()));
$this->expectExceptionMessage(sprintf('%s/composer.json: invalid JSON', $fileSystem));

new Context($fileSystem->url());
new Context($fileSystem);
}

public function testWillNotInstantiateWithoutComposerJsonAutoload(): void
{
$fileSystem = vfsStream::setup('root', 0644, [
$fileSystem = TemporaryDirectory::create([
'composer.json' => '{}',
]);
$this->expectExceptionMessage(sprintf('%s/composer.json: key "autoload" not found', $fileSystem->url()));
$this->expectExceptionMessage(sprintf('%s/composer.json: key "autoload" not found', $fileSystem));

new Context($fileSystem->url());
new Context($fileSystem);
}

public function testWillNotInstantiateWithoutComposerJsonAutoloadPSR4(): void
{
$fileSystem = vfsStream::setup('root', 0644, [
$fileSystem = TemporaryDirectory::create([
'composer.json' => '{"autoload":[]}',
]);
$this->expectExceptionMessage(
sprintf('%s/composer.json: key "autoload"."psr-4" not found', $fileSystem->url())
sprintf('%s/composer.json: key "autoload"."psr-4" not found', $fileSystem)
);

new Context($fileSystem->url());
new Context($fileSystem);
}

public function testWillDetectCoreArchitectureWhenUsed(): void
{
$fileSystem = vfsStream::setup('root', 0644, [
$fileSystem = TemporaryDirectory::create([
'composer.json' => '{
"autoload": {
"psr-4": {
Expand All @@ -65,13 +65,13 @@ public function testWillDetectCoreArchitectureWhenUsed(): void
}',
]);

$context = new Context($fileSystem->url());
$context = new Context($fileSystem);
$this->assertTrue($context->hasCore());
}

public function testWillDetectCoreArchitectureWhenNotUsed(): void
{
$fileSystem = vfsStream::setup('root', 0644, [
$fileSystem = TemporaryDirectory::create([
'composer.json' => '{
"autoload": {
"psr-4": {
Expand All @@ -82,13 +82,13 @@ public function testWillDetectCoreArchitectureWhenNotUsed(): void
}',
]);

$context = new Context($fileSystem->url());
$context = new Context($fileSystem);
$this->assertFalse($context->hasCore());
}

public function testWillDetectProjectTypeAdmin(): void
{
$fileSystem = vfsStream::setup('root', 0644, [
$fileSystem = TemporaryDirectory::create([
'composer.json' => '{
"autoload": {
"psr-4": {
Expand All @@ -99,7 +99,7 @@ public function testWillDetectProjectTypeAdmin(): void
}',
]);

$context = new Context($fileSystem->url());
$context = new Context($fileSystem);
$this->assertTrue($context->isAdmin());
$this->assertFalse($context->isApi());
$this->assertFalse($context->isFrontend());
Expand All @@ -110,7 +110,7 @@ public function testWillDetectProjectTypeAdmin(): void

public function testWillDetectProjectTypeApi(): void
{
$fileSystem = vfsStream::setup('root', 0644, [
$fileSystem = TemporaryDirectory::create([
'composer.json' => '{
"autoload": {
"psr-4": {
Expand All @@ -121,7 +121,7 @@ public function testWillDetectProjectTypeApi(): void
}',
]);

$context = new Context($fileSystem->url());
$context = new Context($fileSystem);
$this->assertFalse($context->isAdmin());
$this->assertTrue($context->isApi());
$this->assertFalse($context->isFrontend());
Expand All @@ -132,7 +132,7 @@ public function testWillDetectProjectTypeApi(): void

public function testWillDetectProjectTypeFrontend(): void
{
$fileSystem = vfsStream::setup('root', 0644, [
$fileSystem = TemporaryDirectory::create([
'composer.json' => '{
"autoload": {
"psr-4": {
Expand All @@ -143,7 +143,7 @@ public function testWillDetectProjectTypeFrontend(): void
}',
]);

$context = new Context($fileSystem->url());
$context = new Context($fileSystem);
$this->assertFalse($context->isAdmin());
$this->assertFalse($context->isApi());
$this->assertTrue($context->isFrontend());
Expand All @@ -154,7 +154,7 @@ public function testWillDetectProjectTypeFrontend(): void

public function testWillDetectProjectTypeLight(): void
{
$fileSystem = vfsStream::setup('root', 0644, [
$fileSystem = TemporaryDirectory::create([
'composer.json' => '{
"autoload": {
"psr-4": {
Expand All @@ -165,7 +165,7 @@ public function testWillDetectProjectTypeLight(): void
}',
]);

$context = new Context($fileSystem->url());
$context = new Context($fileSystem);
$this->assertFalse($context->isAdmin());
$this->assertFalse($context->isApi());
$this->assertFalse($context->isFrontend());
Expand All @@ -176,7 +176,7 @@ public function testWillDetectProjectTypeLight(): void

public function testWillDetectProjectTypeQueue(): void
{
$fileSystem = vfsStream::setup('root', 0644, [
$fileSystem = TemporaryDirectory::create([
'composer.json' => '{
"autoload": {
"psr-4": {
Expand All @@ -187,7 +187,7 @@ public function testWillDetectProjectTypeQueue(): void
}',
]);

$context = new Context($fileSystem->url());
$context = new Context($fileSystem);
$this->assertFalse($context->isAdmin());
$this->assertFalse($context->isApi());
$this->assertFalse($context->isFrontend());
Expand Down
Loading
Loading