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

New task: Change usages of FakerPHP property accessors to method calls #47

Closed
ordago opened this issue Oct 12, 2021 · 4 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@ordago
Copy link

ordago commented Oct 12, 2021

What would you like to do?

FakerPHP/Faker#164

In that pull request FakerPHP has marked property access as deprecated

    /**
     * @param string $attribute
     *
     * @deprecated Use a method instead.
     */
    public function __get($attribute)
    {
        trigger_deprecation('fakerphp/faker', '1.14', 'Accessing property "%s" is deprecated, use "%s()" instead.', $attribute, $attribute);


        return $this->format($attribute);
    }

Before/After code snippets

- $this->faker->lastName;
+ $this->faker->lastName();
@ordago ordago added the pending label Oct 12, 2021
@jasonmccreary jasonmccreary added enhancement New feature or request and removed pending labels Oct 12, 2021
@jasonmccreary
Copy link
Collaborator

@jessarcher, this could be a cool PHP task.

@jessarcher
Copy link
Collaborator

This is a great idea!

@jasonmccreary
Copy link
Collaborator

Sorry for the delay here. This was added a little while back as the Faker methods task.

@ordago
Copy link
Author

ordago commented Feb 22, 2022

@jasonmccreary 👍 saw it on the changelog at the time.

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

No branches or pull requests

3 participants