Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strict paths solver #71

Open
krzysztofrewak opened this issue May 11, 2022 · 0 comments
Open

Strict paths solver #71

krzysztofrewak opened this issue May 11, 2022 · 0 comments
Labels
discussion Let's talk enhancement New feature or request

Comments

@krzysztofrewak
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Let's talk enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant