Skip to content

Support safe ^2.0 #28

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

Merged
merged 2 commits into from
Jan 17, 2022
Merged

Conversation

dbrekelmans
Copy link
Collaborator

No description provided.

@nealio82
Copy link

nealio82 commented Jan 7, 2022

WEN MERGE? 😢

@dbrekelmans
Copy link
Collaborator Author

@moufmouf Could you take a look when you have time? I'm only a maintainer on the safe repo, not on this one :)

Copy link
Contributor

@Jean85 Jean85 left a comment

Choose a reason for hiding this comment

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

Just updated to this alongside safe 2.0.2, it seems to work.

@akondas
Copy link

akondas commented Jan 12, 2022

release? 🙏

@dbrekelmans
Copy link
Collaborator Author

I've created a release on my fork for anyone to use until this PR is merged:

If you use this, please take into consideration that I will abandon/remove the fork as soon as this PR is merged.

This was referenced Jan 14, 2022
@webard
Copy link

webard commented Jan 14, 2022

@dbrekelmans you have error in your fork in FunctionsListLoader.php, method should getFunctionList be:

 public static function getFunctionList(): array
    {
        if (self::$functions === null) {
            if (\file_exists(__DIR__.'/../../../safe/generated/functionsList.php')) {
                $functions = require __DIR__.'/../../../safe/generated/functionsList.php';
            } elseif (\file_exists(__DIR__.'/../../../../../vendor/thecodingmachine/safe/generated/functionsList.php')) {
                $functions = require __DIR__.'/../../../../../vendor/thecodingmachine/safe/generated/functionsList.php';
            } else {
                throw new \RuntimeException('Could not find thecodingmachine/safe\'s functionsList.php file.');
            }
            // Let's index these functions by their name
            self::$functions = \Safe\array_combine($functions, $functions);
        }
        return self::$functions;
    }

@dbrekelmans
Copy link
Collaborator Author

@webard I'm not sure what you mean... I didn't change anything in my fork except for merging this PR.

https://github.com/dbrekelmans/phpstan-safe-rule/blob/v1.2.0/src/Utils/FunctionListLoader.php

@webard
Copy link

webard commented Jan 17, 2022

@dbrekelmans thecodingmachine/safe and thecodingmachine/phpstan-safe-rule are in same directory. in vendor. Your package is in dbrekelmans/phpstan-safe-rule, so you need change path relativity in function getFunctionList.

@dbrekelmans
Copy link
Collaborator Author

@webard Ah I see what you mean, thanks for the heads up. I don't have time to fix it myself today, but if you are willing to create a PR, I can merge and release it

@moufmouf
Copy link
Member

Hey @dbrekelmans,

I'm really sorry I only see this now.
Of course, if you are maintainer on Safe you also need to be maintainer on this package. I added you as a maintainer right now.

@dbrekelmans dbrekelmans merged commit 8a7b88e into thecodingmachine:master Jan 17, 2022
@dbrekelmans
Copy link
Collaborator Author

No problem @moufmouf, thanks for adding me as a maintainer!

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

Successfully merging this pull request may close these issues.

7 participants