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

feat: add config builder class #45

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

owenvoke
Copy link
Member

@owenvoke owenvoke commented Sep 25, 2024

Closes #44

This implements a new wrapper around the ContainerConfigurator. In future, it would be nice to move to a custom solution, but for now this just simplifies the config.

<?php declare(strict_types=1);

use Worksome\Graphlint\Config\GraphlintConfig;

return GraphlintConfig::configure()
    ->withPreparedSets(standard: true);

@owenvoke owenvoke requested review from a team and odinns September 25, 2024 14:38
/** @param array<class-string<Inspection>> $inspections */
public function withInspections(array $inspections): self
{
$this->inspections = [...$this->inspections, ...$inspections];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if these should be overwriting the values, or merging. 🤷🏻

}

foreach ($this->inspections as $inspection) {
$services->set($inspection)->tag(Visitor::COMPILED);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently just tagging all inspections as being for the compiled schema, as we don't support original yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add GraphlintConfig configuration class
1 participant