Skip to content

Update meilisearch/meilisearch-php requirement from ^0.11 to ^0.12 #7

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

Merged

Conversation

dependabot-preview[bot]
Copy link
Contributor

@dependabot-preview dependabot-preview bot commented Jul 9, 2020

Updates the requirements on meilisearch/meilisearch-php to permit the latest version.

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Note: This repo was added to Dependabot recently, so you'll receive a maximum of 5 PRs for your first few update runs. Once an update run creates fewer than 5 PRs we'll remove that limit.

You can always request more updates by clicking Bump now in your Dependabot dashboard.

Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
  • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot dashboard:

  • Update frequency (including time of day and day of week)
  • Pull request limits (per update run and/or open at any time)
  • Out-of-range updates (receive only lockfile updates, if desired)
  • Security updates (receive only security updates, if desired)

@dependabot-preview dependabot-preview bot added dependencies skip-changelog The PR will not appear in the release changelogs labels Jul 9, 2020
Updates the requirements on meilisearch/meilisearch-php to permit the latest version.

Signed-off-by: dependabot-preview[bot] <[email protected]>
@dependabot-preview dependabot-preview bot force-pushed the dependabot/composer/meilisearch/meilisearch-php-tw-0.12 branch from 9140e19 to f828ca9 Compare July 9, 2020 13:23
@curquiza
Copy link
Member

curquiza commented Jul 9, 2020

This issue #9 needs to be closed before merging this PR.

@curquiza curquiza marked this pull request as draft July 9, 2020 14:57
@curquiza curquiza marked this pull request as ready for review July 9, 2020 17:39
@@ -21,7 +21,7 @@

<service id="search.client" class="MeiliSearch\Client" public="true" lazy="true">
<argument key="$url">%env(MEILISEARCH_URL)%</argument>
<argument key="$api_key">%env(MEILISEARCH_API_KEY)%</argument>
<argument key="$apiKey">%env(MEILISEARCH_API_KEY)%</argument>
Copy link
Member

@curquiza curquiza Jul 9, 2020

Choose a reason for hiding this comment

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

I'm worried... Why does this line fix the test? @emulienfou

Copy link
Contributor

Choose a reason for hiding this comment

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

@curquiza Because in the package meilisearch-php the constructor argument has been rename from snake_case to camelCase since version 0.12.0

Copy link
Member

@curquiza curquiza Jul 9, 2020

Choose a reason for hiding this comment

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

I did not realize that: for me the apiKey value was only internal... I did not know that the user can access it this way! Good to know!

Copy link
Member

@curquiza curquiza Jul 9, 2020

Choose a reason for hiding this comment

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

So, in php, changing a variable name in the parameter for a method is breaking? Or only for constructors? @emulienfou

Copy link
Contributor

Choose a reason for hiding this comment

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

@curquiza a constructor is public instead if you make it protected or private.
In Symfony I created a new service who create a new instance of MeiliSearch/Client and passing some parameters like the apiKey.
The code need to know the parameter's name to do that

Copy link
Member

@curquiza curquiza Jul 10, 2020

Choose a reason for hiding this comment

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

@emulienfou for me, you call the constructor this way:

$client = new Client('http://127.0.0.1:7700', 'masterKey');

No matter what the name of the parameters. I did not realize you can call the constructor the way you did in PHP! That's why I ask if you can do the same with a "basic" method, not a constructor.

Thanks a lot! I learn more and more in PHP 🙂

Copy link
Contributor

Choose a reason for hiding this comment

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

@curquiza This is more related to Symfony than PHP itself.
You can find more information about Symfony Services right here: https://symfony.com/doc/current/service_container.html#manually-wiring-arguments

@emulienfou emulienfou merged commit 4187a75 into master Jul 9, 2020
@emulienfou emulienfou deleted the dependabot/composer/meilisearch/meilisearch-php-tw-0.12 branch July 9, 2020 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies skip-changelog The PR will not appear in the release changelogs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants