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

refactor: rename constrain to scope #185

Closed

Conversation

hustlahusky
Copy link
Contributor

Closes #65

  • Replace "constrain" with "scope" all over the code base
  • Add BC aliases with deprecation replacement suggestion (need to ignore cs warning on alias files)

@wolfy-j wolfy-j requested a review from roxblnfk May 18, 2021 18:32
@wolfy-j
Copy link
Contributor

wolfy-j commented May 18, 2021

I believe it's best to add for v2.

@hustlahusky
Copy link
Contributor Author

Ok. I can rebase this changes to 2.0 branch later. Should I drop BC aliases then?

@wolfy-j
Copy link
Contributor

wolfy-j commented May 20, 2021

Yes, we can BC them for v2.

@roxblnfk
Copy link
Member

roxblnfk commented May 20, 2021

I think this PR can be ok for v1.x
User also can use the old constant that marked as deprecated. In v2 we can break BC and remove the deprecated constant

@wolfy-j
Copy link
Contributor

wolfy-j commented May 20, 2021

You can approve it then :)

@roxblnfk
Copy link
Member

You can approve it then :)

👍
But too lot changes :) i will review this later

@roxblnfk roxblnfk modified the milestone: rrrrrr May 20, 2021
@hustlahusky hustlahusky force-pushed the 65-rename-constrain-to-scope branch 2 times, most recently from 1617be5 to 0b2566f Compare May 30, 2021 15:38
@hustlahusky hustlahusky force-pushed the 65-rename-constrain-to-scope branch from 0b2566f to 7e0f3a9 Compare May 30, 2021 16:39
@wolfy-j
Copy link
Contributor

wolfy-j commented Jun 5, 2021

Ping @roxblnfk

@roxblnfk
Copy link
Member

roxblnfk commented Jun 5, 2021

If @hustlahusky will do not force push changes with overwriting previous commits then i ready to review ;)

@roxblnfk
Copy link
Member

roxblnfk commented Jun 5, 2021

Also not all tests passed

@hustlahusky
Copy link
Contributor Author

If @hustlahusky will do not force push changes with overwriting previous commits then i ready to review ;)

Yeah. I finished with changes for now :)

Also not all tests passed

Tests are ok. Only check failed is code style caused by warnings in BC aliases files. It needs to be ignored, but I don't know how to do that

Copy link
Member

@roxblnfk roxblnfk left a comment

Choose a reason for hiding this comment

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

I think we need to add tests that check:

  • old methods are work
  • old interfaces (classes) are work
  • old options and constants work too

* @return SourceInterface
*/
public function withConstrain(?ConstrainInterface $constrain): SourceInterface;
public function withScope(?ScopeInterface $scope): SourceInterface;
Copy link
Member

Choose a reason for hiding this comment

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

I understand that this is an internal API, but adding new methods to the interface is a major change. @wolfy-j , what do you think about that?


declare(strict_types=1);

namespace Cycle\ORM\Select\Scope;
Copy link
Member

Choose a reason for hiding this comment

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

This class can placed in the Cycle\ORM\Selectnamespace similar to the \Cycle\ORM\Select\ConstrainInterface.
Why do you think it is worth allocating a separate directory for it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have plans to add some more scope options in future for #24, that can be helpful for implementing extra lazy collection behavior like in doctrine

src/Select/JoinableLoader.php Show resolved Hide resolved
src/Select/JoinableLoader.php Show resolved Hide resolved
@roxblnfk
Copy link
Member

roxblnfk commented Jun 7, 2021

Tests are ok. Only check failed is code style caused by warnings in BC aliases files. It needs to be ignored, but I don't know how to do that

I think you can move deprecated stubs in the resources/stubs directory like here

@hustlahusky
Copy link
Contributor Author

Split small improvements that can be merged to v1 in #191
I will open new PR to v2 with other changes later

@roxblnfk
Copy link
Member

I will open new PR to v2 with other changes later

Be careful, because now branch 2.0 is actively changing.

@hustlahusky hustlahusky deleted the 65-rename-constrain-to-scope branch July 14, 2021 07:48
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.

Constrain -> Scope
3 participants