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

minor changes in Query class #733

Merged
merged 3 commits into from
Jan 2, 2015

Conversation

webdevsHub
Copy link
Contributor

small improvements for new documentation in ruflin/Elastica.io#27

*/
public function setRescore($rescore)
public function setRescore(AbstractRescore $rescore)
Copy link
Contributor

Choose a reason for hiding this comment

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

You realize that by adding a new typehint to class that somebody might be extending is a BC break? Adding typehints is a good thing, but then the release process should take that into account (=change like this should not appear in patch version release and ideally not even in feature version release).

Copy link
Owner

Choose a reason for hiding this comment

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

@webdevsHub I suggest you mention this in the changes.txt as a BC break.

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 just thought it would be better then getting a Fatal Error on
$rescore->toArray() line.

What do you suggest to do to take the release process into account?
Am 14.12.2014 18:36 schrieb "Filip Procházka" [email protected]:

In lib/Elastica/Query.php
#733 (diff):

  */
  • public function setRescore($rescore)
  • public function setRescore(AbstractRescore $rescore)

You realize that by adding a new typehint to class that somebody might be
extending is a BC break? Adding typehints is a good thing, but then the
release process should take that into account (=change like this should not
appear in patch version release and ideally not even in feature version
release).


Reply to this email directly or view it on GitHub
https://github.com/ruflin/Elastica/pull/733/files#r21797723.

Copy link
Contributor

Choose a reason for hiding this comment

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

You can always do "manual check"

if (!$rescore instanceof AbstractRescore) {
    throw new \LogicException(sprintf('Instance of AbstractRescore expected, but %s was given.', get_type($rescore)));
}

return $this->setParam('rescore', $rescore->toArray());

About the release process, it doesn't matter if change like this is in master branch, but it does matter if it's in some release-branch and if it it's tagged.

@ruflin
Copy link
Owner

ruflin commented Dec 21, 2014

@webdevsHub We could go a step by step approach. With the option proposed by @fprochazka we "break" BC but it throws a proper exception. For me both options are fine, important is that such breaks are mentioned in the release log (changes.txt). Can you update the changes.txt file?

@webdevsHub
Copy link
Contributor Author

okay, I removed that typehint. The important one was the return statement anyway

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) when pulling 40eb3e5 on webdevsHub:query-class-improvements into 990b89f on ruflin:master.

ruflin added a commit that referenced this pull request Jan 2, 2015
@ruflin ruflin merged commit 4f8d094 into ruflin:master Jan 2, 2015
@ruflin
Copy link
Owner

ruflin commented Jan 2, 2015

Merged. Thx.

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.

4 participants