-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
The 0.x codestyle with ECS underneath threw errors when one of provided paths was not in the project. Since 1.x codestyle just goes further without any notice.
AC: I would like to get error when I'm trying to scan non-existing directory/file. Default behaviour should still be silent mode, but it should be configurable. I have four (!) implementations in mind and I'm open to discussion:
Option 1️⃣:
<?php
declare(strict_types=1);
use Blumilk\Codestyle\Config;
use Blumilk\Codestyle\Configuration\Defaults\LaravelPaths;
$paths = new LaravelPaths();
$config = new Config(
paths: $paths->add("codestyle.php"),
strictPaths: true,
);
return $config->config();Option 2️⃣:
<?php
declare(strict_types=1);
use Blumilk\Codestyle\Config;
use Blumilk\Codestyle\Configuration\Defaults\LaravelPaths;
$paths = new LaravelPaths();
$config = new Config(
paths: $paths->add("codestyle.php"),
);
return $config->withStrictPaths()->config();Option 3️⃣:
<?php
declare(strict_types=1);
use Blumilk\Codestyle\Config;
use Blumilk\Codestyle\Configuration\Defaults\LaravelPaths;
$paths = new LaravelPaths();
$config = new Config(
paths: $paths->add("codestyle.php"),
config: ["paths" => "strict"]
);
return $config->config();Option 4️⃣:
<?php
declare(strict_types=1);
use Blumilk\Codestyle\Config;
use Blumilk\Codestyle\Configuration\Defaults\LaravelPaths;
$paths = new LaravelPaths(strict: true);
$config = new Config(
paths: $paths->add("codestyle.php"),
);
return $config->config();"Strict paths" is just a placeholder. We can switch it with other proposition.