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

Add support for using strict types in configs #4

Merged
merged 6 commits into from
Sep 18, 2024

Conversation

austinkregel
Copy link
Contributor

@austinkregel austinkregel commented Sep 17, 2024

Greetings!

This PR aims to add support for config files that have declare(strict_types=true); at the top of the file like so

<?php

declare (strict_types=1);

use Illuminate\Support\Facades\Facade;

return [

    'aliases' => Facade::defaultAliases()->merge([
        // 'Example' => App\Facades\Example::class,
        'Operator' => App\Operations\Operator::class,
    ])->toArray(),

];

At present any project that tries to use this package, while also having strict types in the config will not work. The ArrayFile will throw an exception that there is no return even if there is.

I'm not sure how wide of a practice it is to use strict types, but it's quite frequent at my work and my personal projects.

@austinkregel austinkregel marked this pull request as ready for review September 17, 2024 04:37
@LukeTowers LukeTowers merged commit 6866e60 into wintercms:main Sep 18, 2024
7 checks passed
@austinkregel austinkregel deleted the add-support-for-strict-types branch September 19, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants