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 Association::$finder type #12770

Merged
merged 2 commits into from Nov 28, 2018

Conversation

Projects
None yet
3 participants
@o0h
Contributor

o0h commented Nov 28, 2018

phpdoc describes type string, but it can retrieve an array as [$finder:string, $options:array] .
We can use this as bellow.

$Table->belongsTo('Users')
    ->setFinder(['custom' => ['opt1' => 'some value']]);

This works like:

// ORM\Association
$this->getTarget()->find($type, $options + $opts);

Because _extractFinder() method returns array including options.
https://github.com/cakephp/cakephp/blob/3.7.0-RC3/src/ORM/Association.php#L1391-L1399

@@ -886,7 +887,7 @@ public function setFinder($finder)
*
* @deprecated 3.4.0 Use setFinder()/getFinder() instead.
* @param string|null $finder the finder name to use
* @return string
* @return string|array

This comment has been minimized.

@ADmad

ADmad Nov 28, 2018

Member

Return type of getFinder() method should also be updated.

This comment has been minimized.

@o0h

o0h Nov 28, 2018

Contributor

pushed 1a46ad9 😄

@ADmad ADmad added this to the 3.6.14 milestone Nov 28, 2018

@ADmad ADmad added the documentation label Nov 28, 2018

@codecov

This comment has been minimized.

codecov bot commented Nov 28, 2018

Codecov Report

Merging #12770 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #12770   +/-   ##
=========================================
  Coverage     90.08%   90.08%           
  Complexity    13576    13576           
=========================================
  Files           467      467           
  Lines         34846    34846           
=========================================
  Hits          31390    31390           
  Misses         3456     3456
Impacted Files Coverage Δ Complexity Δ
src/ORM/Association.php 98.68% <ø> (ø) 137 <0> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0bb8194...1a46ad9. Read the comment docs.

1 similar comment
@codecov

This comment has been minimized.

codecov bot commented Nov 28, 2018

Codecov Report

Merging #12770 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #12770   +/-   ##
=========================================
  Coverage     90.08%   90.08%           
  Complexity    13576    13576           
=========================================
  Files           467      467           
  Lines         34846    34846           
=========================================
  Hits          31390    31390           
  Misses         3456     3456
Impacted Files Coverage Δ Complexity Δ
src/ORM/Association.php 98.68% <ø> (ø) 137 <0> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0bb8194...1a46ad9. Read the comment docs.

@markstory markstory merged commit 8bb2862 into cakephp:master Nov 28, 2018

2 of 3 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
Scrutinizer No new issues
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment