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

fix WizardStep class property title does not return the value of it's title method #26

Closed

Conversation

bfiessinger
Copy link

Currently a WizardSteps title property does not respect the return value of $this->title(). For Steps with dynamic titles this should be fixed.

@ksassnowski
Copy link
Collaborator

ksassnowski commented Sep 14, 2021

I feel like there’s a bit of confusing about the connection between the $title property and the title() function of the WizardStep class.

Internally, Arcanist only ever refers to the title() method of the step (https://github.com/laravel-arcanist/arcanist/blob/main/src/AbstractWizard.php#L270). It’s just that the default implementation of the method simply returns the $title property. What this means is that you’re only supposed to use title() method when accessing a step’s title. But I can see how that’s not obvious since the field is also public.

That being said, I don’t really see an issue with merging this PR since it would remove the ambiguity and doesn’t really break any behavior.

@ksassnowski
Copy link
Collaborator

Can you add a test or two for the WizardStep to check that the $title property gets set correctly when calling $step->init(...)?

@bfiessinger
Copy link
Author

Sorry did not have had time to update this PR. But in the meantime I encountered some issues when merging this, e.g. the title method won't be able to make use of $this->data('key') so I'm closing this. For now it's only possible to get the computed title by the steps array.

@bfiessinger bfiessinger closed this Oct 5, 2021
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.

None yet

2 participants