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

Model::__callStatic() enhancements #14467

Merged
merged 7 commits into from Oct 15, 2019

Conversation

@zsilbi
Copy link
Contributor

zsilbi commented Oct 14, 2019

Hello!

  • Type: code quality
  • Link to issue: #14467

In raising this pull request, I confirm the following:

  • I have read and understood the Contributing Guidelines
  • I have checked that another pull request for this purpose does not exist
  • I wrote some tests for this PR
  • I have updated the relevant CHANGELOG
  • I have created a PR for the documentation about this change

Small description of change:

Phalcon\Mvc\Model::__callStatic() now throws an exception if the called method is unknown.
Added tests for Phalcon\Mvc\Model::__callStatic().

Thanks,
zsilbi

zsilbi added 5 commits Oct 14, 2019
 `0` and `null` as parameter.
@zsilbi

This comment has been minimized.

Copy link
Contributor Author

zsilbi commented Oct 14, 2019

Magic methods using Model::__callStatic() now accept 0 and null and also an empty string as parameter.

These function calls are now valid:

Robots::findByField(null);
Robots::findByField("");
Robots::findByField(0);

Robots::findFirstByField(null);
Robots::findFirstByField("");
Robots::findFirstByField(0);

Robots::countByField(null);
Robots::countByField("");
Robots::countByField(0);
@codecov

This comment has been minimized.

Copy link

codecov bot commented Oct 14, 2019

Codecov Report

Merging #14467 into 4.0.x will increase coverage by 0.02%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##            4.0.x   #14467      +/-   ##
==========================================
+ Coverage   67.67%   67.69%   +0.02%     
==========================================
  Files         482      482              
  Lines      111331   111360      +29     
==========================================
+ Hits        75339    75390      +51     
+ Misses      35992    35970      -22
@zsilbi zsilbi changed the title Changed Model::__callStatic() to throw an exception for unknown calls Model::__callStatic() enhancements Oct 14, 2019
@niden niden added this to In progress in 4.0 Release via automation Oct 14, 2019
@niden
niden approved these changes Oct 14, 2019
@niden niden merged commit 6298372 into phalcon:4.0.x Oct 15, 2019
4 checks passed
4 checks passed
codecov/patch Coverage not affected when comparing a26ad41...6298372
Details
codecov/project 67.56% (-0.11%) compared to a26ad41
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
4.0 Release automation moved this from In progress to Done Oct 15, 2019
@niden

This comment has been minimized.

Copy link
Member

niden commented Oct 15, 2019

Thank you @zsilbi

@zsilbi zsilbi deleted the zsilbi:model-callstatic-exception branch Oct 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
4.0 Release
  
Done
3 participants
You can’t perform that action at this time.