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

replace layout and overlay to proper Enum types #2015

Merged
merged 5 commits into from
Sep 16, 2023
Merged

Conversation

ildyria
Copy link
Member

@ildyria ildyria commented Sep 16, 2023

The layout was using int: 0,1,2.

This created some weird php trickery where we could not make the difference between:

$arr = [
	'0' => 'translation 0',
	'1' => 'translation 1',
	'2' => 'translation 2'
];

and

$arr = [
	'translation 0',
	'translation 1',
	'translation 2'
];

Due to type inference, php would assume that the arrays are the same, while the intent is not there.
The keys in that specific case are the intended config option and the value are the translations.
This is breaking and making code complex on Livewire front-end.

By changing this to proper Enum types, we are making the configuration cleaner.

Because this is a migration change. This will in 4.12.0

@ildyria ildyria added the Review: easy Easy review expected: probably just need a quick to go through. label Sep 16, 2023
@ildyria ildyria added this to the 4.12.0 milestone Sep 16, 2023
@codecov
Copy link

codecov bot commented Sep 16, 2023

Codecov Report

Merging #2015 (2f6848c) into master (49c1667) will decrease coverage by 0.26%.
Report is 1 commits behind head on master.
The diff coverage is 100.00%.

Additional details and impacted files

Copy link
Contributor

@qwerty287 qwerty287 left a comment

Choose a reason for hiding this comment

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

There's no PR for the frontend yet?

@ildyria
Copy link
Member Author

ildyria commented Sep 16, 2023

https://github.com/LycheeOrg/Lychee-front/pull/409/files

@ildyria ildyria merged commit 8eb6310 into master Sep 16, 2023
@ildyria ildyria deleted the refactor-type-layout branch September 16, 2023 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review: easy Easy review expected: probably just need a quick to go through.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants