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

chore - rename Client to IpQueryClient class +semver: minor #9

Merged
merged 2 commits into from
Dec 25, 2024

Conversation

guibranco
Copy link
Owner

@guibranco guibranco commented Dec 25, 2024

πŸ“‘ Description

Rename Client to IpQueryClient class.

βœ… Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

☒️ Does this introduce a breaking change?

  • Yes
  • No

Summary by Sourcery

Rename the Client class to IpQueryClient.

New Features:

  • Add explicit dependency on the cURL extension.

Enhancements:

  • Standardize the code style in CONTRIBUTING.md.

Tests:

  • Update tests to use the new IpQueryClient class name.

Chores:

  • Update documentation and tests to reflect the class name change.

Description by Korbit AI

What change is being made?

Rename the Client class to IpQueryClient and update all relevant references throughout the codebase.

Why are these changes being made?

The renaming improves code clarity by making the purpose of the class more explicit, distinguishing it from other potential client classes in the codebase. This change aims to enhance maintainability and readability for developers interacting with the class, reducing ambiguity in its role and functionality.

Is this description stale? Ask me to generate a new description by commenting /korbit-generate-pr-description

Summary by CodeRabbit

  • New Features

    • Updated documentation to reflect the new class name for the IP query client.
    • Added a requirement for the ext-curl PHP extension for library functionality.
  • Bug Fixes

    • Enhanced readability of the contributing guidelines through formatting updates.
  • Documentation

    • Updated examples and documentation to use the new IpQueryClient class name.
    • Updated PHP version requirement from 7.4 to 8.2 in documentation.
  • Refactor

    • Renamed classes and interfaces to improve clarity and consistency in naming conventions.
  • Tests

    • Updated test class and methods to align with the new naming convention for the IP query client.

Copy link
Contributor

sourcery-ai bot commented Dec 25, 2024

Reviewer's Guide by Sourcery

This pull request renames the Client class to IpQueryClient across the project. This includes updating the class name in the source code, tests, examples, and documentation. The change is considered a breaking change, requiring a version bump.

Class diagram showing the renamed Client to IpQueryClient

classDiagram
    class IpQueryResponse {
    }
    class IpQueryException {
    }

    class IIpQueryClient {
      <<interface>>
      +getMyIpData() IpQueryResponse
      +getIpData(string ip) IpQueryResponse
    }

    class IpQueryClient {
      -string baseUrl
      +getMyIpData() IpQueryResponse
      +getIpData(string ip) IpQueryResponse
    }

    IIpQueryClient <|.. IpQueryClient
    IpQueryClient ..> IpQueryResponse
    IpQueryClient ..> IpQueryException

    note for IpQueryClient "Renamed from Client"
    note for IIpQueryClient "Renamed from IClient"
Loading

File-Level Changes

Change Details Files
Renamed the Client class to IpQueryClient.
  • Renamed the class in the source file.
  • Renamed the interface associated with the class.
  • Updated tests to reflect the new class name.
  • Updated the documentation to use the new class name.
  • Updated examples to use the new class name.
  • Updated the contributing guidelines to use the new class name.
  • Updated the composer.json file to reflect the new class name and dependencies.
src/Client.php
src/IClient.php
tests/ClientTest.php
composer.json
README.md
examples/example.php
CONTRIBUTING.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@guibranco guibranco enabled auto-merge (squash) December 25, 2024 17:17
@gstraccini gstraccini bot added the β˜‘οΈ auto-merge Automatic merging of pull requests (gstraccini-bot) label Dec 25, 2024
Copy link
Contributor

coderabbitai bot commented Dec 25, 2024

Walkthrough

This pull request introduces several formatting updates and renaming changes across the IpQuery PHP library. Key modifications include the renaming of the client class from Client to IpQueryClient, and the interface from IClient to IIpQueryClient. Additionally, the minimum PHP version requirement has been updated from 7.4 to 8.2 in multiple files, including CONTRIBUTING.md, README.md, and composer.json. Indentation improvements were made in the CONTRIBUTING.md file for better readability.

Changes

File Change Summary
CONTRIBUTING.md Added indentation to bullet points for improved readability; updated PHP version requirement from 7.4 to 8.2
README.md Updated client class name from Client to IpQueryClient and updated PHP version requirement from 7.4 to 8.2
composer.json Updated PHP version requirement from >=7.4 to >=8.2 and moved ext-curl from require-dev to require section
examples/example.php Replaced Client with IpQueryClient
src/IIpQueryClient.php Renamed interface from IClient to IIpQueryClient
src/IpQueryClient.php Renamed class from Client to IpQueryClient and updated interface implementation
tests/IpQueryClientTest.php Updated test class name from ClientTest to IpQueryClientTest and client references from Client to IpQueryClient

Possibly related PRs

Suggested labels

size/M, documentation, Review effort [1-5]: 2

Suggested reviewers

  • gstraccini
  • sourcery-ai

Poem

🐰 A Rabbit's Refactor Tale 🐰
In lines of code, a change takes flight,
From Client to IpQueryClient so bright,
Renaming with precision and care,
A transformation beyond compare,
Hopping through files with glee and might! πŸš€


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❀️ Share
πŸͺ§ Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 25, 2024
Copy link

deepsource-io bot commented Dec 25, 2024

Here's the code health analysis summary for commits 34f3348..2e5ecb9. View details on DeepSourceΒ β†—.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Test coverage LogoTest coverageβœ…Β SuccessView CheckΒ β†—
DeepSource Secrets LogoSecretsβœ…Β SuccessView CheckΒ β†—
DeepSource PHP LogoPHPβœ…Β SuccessView CheckΒ β†—

Code Coverage Report

MetricAggregatePhp
Branch Coverage100%100%
Composite Coverage78.5%78.5%
Line Coverage78.5%78.5%

πŸ’‘ If you’re a repository administrator, you can configure the quality gates from the settings.

Copy link

codacy-production bot commented Dec 25, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
βœ… +78.48% (target: -1.00%) βœ… βˆ…
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (34f3348) 0 0 0.00%
Head commit (2e5ecb9) 79 (+79) 62 (+62) 78.48% (+78.48%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#9) 0 0 βˆ… (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settingsΒ Β Β Β Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @guibranco - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟑 General issues: 1 issue found
  • 🟒 Security: all looks good
  • 🟒 Testing: all looks good
  • 🟒 Complexity: all looks good
  • 🟒 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click πŸ‘ or πŸ‘Ž on each comment and I'll use the feedback to improve your reviews.

CONTRIBUTING.md Show resolved Hide resolved
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

Markdownlint (reported by Codacy) found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

I've completed my review and didn't find any issues.

Files scanned ​
File Path Reviewed
src/IIpQueryClient.php βœ…
examples/example.php βœ…
src/IpQueryClient.php βœ…

Explore our documentation to understand the languages and file types we support and the files we ignore.

Need a new review? Comment /korbit-review on this PR and I'll review your latest changes.

Korbit Guide: Usage and Customization

Interacting with Korbit

  • You can manually ask Korbit to review your PR using the /korbit-review command in a comment at the root of your PR.
  • You can ask Korbit to generate a new PR description using the /korbit-generate-pr-description command in any comment on your PR.
  • Too many Korbit comments? I can resolve all my comment threads if you use the /korbit-resolve command in any comment on your PR.
  • Chat with Korbit on issues we post by tagging @korbit-ai in your reply.
  • Help train Korbit to improve your reviews by giving a πŸ‘ or πŸ‘Ž on the comments Korbit posts.

Customizing Korbit

  • Check out our docs on how you can make Korbit work best for you and your team.
  • Customize Korbit for your organization through the Korbit Console.

Current Korbit Configuration

General Settings ​
Setting Value
Review Schedule Automatic excluding drafts
Max Issue Count 10
Automatic PR Descriptions βœ…
Issue Categories ​
Category Enabled
Naming βœ…
Database Operations βœ…
Documentation βœ…
Logging βœ…
Error Handling βœ…
Systems and Environment βœ…
Objects and Data Structures βœ…
Readability and Maintainability βœ…
Asynchronous Processing βœ…
Design Patterns βœ…
Third-Party Libraries βœ…
Performance βœ…
Security βœ…
Functionality βœ…

Feedback and Support

Note

Korbit Pro is free for open source projects πŸŽ‰

Looking to add Korbit to your team? Get started with a free 2 week trial here

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
CONTRIBUTING.md (1)

94-94: Add missing preposition

Change:

-Reference any relevant issues.
+Reference to any relevant issues.
🧰 Tools
πŸͺ› LanguageTool

[uncategorized] ~94-~94: Possible missing preposition found.
Context: ...and explain your changes. - Reference any relevant issues. --- ## Code of Condu...

(AI_HYDRA_LEO_MISSING_TO)

πŸͺ› GitHub Check: Markdownlint (reported by Codacy)

[warning] 94-94:
Expected: 1; Actual: 3

πŸ“œ Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 34f3348 and 7f45230.

πŸ“’ Files selected for processing (7)
  • CONTRIBUTING.md (1 hunks)
  • README.md (1 hunks)
  • composer.json (1 hunks)
  • examples/example.php (1 hunks)
  • src/IIpQueryClient.php (1 hunks)
  • src/IpQueryClient.php (1 hunks)
  • tests/IpQueryClientTest.php (4 hunks)
🧰 Additional context used
πŸͺ› LanguageTool
CONTRIBUTING.md

[uncategorized] ~94-~94: Possible missing preposition found.
Context: ...and explain your changes. - Reference any relevant issues. --- ## Code of Condu...

(AI_HYDRA_LEO_MISSING_TO)

πŸͺ› Markdownlint (0.37.0)
CONTRIBUTING.md

80-80: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

πŸͺ› GitHub Check: Markdownlint (reported by Codacy)
CONTRIBUTING.md

[warning] 9-9:
Expected: 1; Actual: 3


[warning] 10-10:
Expected: 1; Actual: 3


[warning] 11-11:
Expected: 1; Actual: 3


[warning] 21-21:
Expected: 1; Actual: 3


[warning] 22-22:
Expected: 1; Actual: 3


[warning] 26-26:
Expected: 1; Actual: 3


[warning] 27-27:
Expected: 1; Actual: 3


[warning] 28-28:
Expected: 1; Actual: 3


[warning] 29-29:
Expected: 1; Actual: 3


[warning] 35-35:
Expected: 1; Actual: 3


[warning] 36-36:
Expected: 1; Actual: 3


[warning] 40-40:
Expected: 1; Actual: 3


[warning] 41-41:
Expected: 1; Actual: 3


[warning] 42-42:
Expected: 1; Actual: 3


[warning] 69-69:
Expected: 1; Actual: 3


[warning] 70-70:
Expected: 1; Actual: 3


[warning] 71-71:
Expected: 1; Actual: 3


[warning] 78-78:
Expected: 1; Actual: 3


[warning] 79-79:
Expected: 1; Actual: 3


[warning] 85-85:
Expected: 1; Actual: 3


[warning] 92-92:
Expected: 1; Actual: 3


[warning] 93-93:
Expected: 1; Actual: 3


[warning] 94-94:
Expected: 1; Actual: 3


[warning] 106-106:
Expected: 1; Actual: 3


[warning] 110-110:
Expected: 1; Actual: 3

πŸ”‡ Additional comments (14)
src/IIpQueryClient.php (1)

7-7: Well-structured interface rename.

Renaming the interface to IIpQueryClient creates a clear contract name that aligns with the new IpQueryClient class and improves discoverability.

examples/example.php (2)

5-5: Imports updated to match the new class name.

Good move to import IpQueryClient instead of Client; this maintains consistency with the recently renamed class.


7-7: Instantiation aligns with the new class name.

Using new IpQueryClient() is consistent with the project's updated naming schema. Confirm that all references elsewhere in the documentation are similarly updated.

src/IpQueryClient.php (1)

8-8: Class rename looks consistent and clear.

Renaming Client to IpQueryClient aligns with the IIpQueryClient interface. Please ensure versioning or other metadata is updated to indicate this breaking change.

tests/IpQueryClientTest.php (7)

6-6: Updated import reference for the renamed class.

Importing IpQueryClient is consistent with the new class name. This ensures tests remain aligned with the updated codebase.


10-10: Class name matches the production code rename.

Renaming the test class to IpQueryClientTest keeps the naming consistent across the codebase.


16-16: Updated instantiation to reflect the renamed class.

Instantiating new IpQueryClient() ensures the test harness aligns with the refactored client name.


22-22: Mock builder references the renamed class.

Confirm that all mock expectations align with the IpQueryClient methods.


38-38: Mock builder updated for testGetIpData.

Switching from Client::class to IpQueryClient::class maintains test accuracy post-rename.


61-61: Mock builder updated for testGetMultipleIpData.

Ensuring the mock references IpQueryClient preserves consistency with the production update.


86-86: Mock builder updated for error-case testing.

Using IpQueryClient::class in the mock aligns with the rename, preserving the test coverage for request failures.

composer.json (1)

24-25: LGTM: Moving ext-curl to runtime dependencies

Moving ext-curl from require-dev to require section is correct as it's a runtime dependency needed for the HTTP client functionality.

README.md (1)

37-37: LGTM: Documentation updated correctly

The README has been properly updated to reflect the new IpQueryClient class name in both the import statement and instantiation example.

Also applies to: 39-39

CONTRIBUTING.md (1)

8-11: LGTM: Improved markdown formatting

The indentation changes improve the readability of bullet points throughout the document.

Also applies to: 18-29, 32-42, 45-94, 105-110

🧰 Tools
πŸͺ› GitHub Check: Markdownlint (reported by Codacy)

[warning] 9-9:
Expected: 1; Actual: 3


[warning] 10-10:
Expected: 1; Actual: 3


[warning] 11-11:
Expected: 1; Actual: 3

composer.json Outdated Show resolved Hide resolved
Copy link

Infisical secrets check: βœ… No secrets leaked!

πŸ’» Scan logs
5:24PM INF scanning for exposed secrets...
5:24PM INF 11 commits scanned.
5:24PM INF scan completed in 85.1ms
5:24PM INF no leaks found

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
50.0% Coverage on New Code (required β‰₯ 80%)

See analysis details on SonarQube Cloud

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
CONTRIBUTING.md (2)

80-84: Fix markdown formatting

Add language specifier to the fenced code block for better syntax highlighting.

-    ```
+    ```txt
     feat: Add awesome feature
     fix: Correct typo in function
     docs: Update README.md
     ```
🧰 Tools
πŸͺ› Markdownlint (0.37.0)

80-80: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


9-110: Fix markdown list indentation

Multiple list items have inconsistent indentation (3 spaces instead of 1). Consider using a markdown formatter to standardize the indentation.

🧰 Tools
πŸͺ› Markdownlint (0.37.0)

80-80: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

πŸͺ› GitHub Check: Markdownlint (reported by Codacy)

[warning] 9-9:
Expected: 1; Actual: 3


[warning] 10-10:
Expected: 1; Actual: 3


[warning] 11-11:
Expected: 1; Actual: 3


[warning] 21-21:
Expected: 1; Actual: 3


[warning] 22-22:
Expected: 1; Actual: 3


[warning] 26-26:
Expected: 1; Actual: 3


[warning] 27-27:
Expected: 1; Actual: 3


[warning] 28-28:
Expected: 1; Actual: 3


[warning] 29-29:
Expected: 1; Actual: 3


[warning] 35-35:
Expected: 1; Actual: 3


[warning] 36-36:
Expected: 1; Actual: 3


[warning] 40-40:
Expected: 1; Actual: 3


[warning] 41-41:
Expected: 1; Actual: 3


[warning] 42-42:
Expected: 1; Actual: 3


[warning] 69-69:
Expected: 1; Actual: 3


[warning] 70-70:
Expected: 1; Actual: 3


[warning] 71-71:
Expected: 1; Actual: 3


[warning] 78-78:
Expected: 1; Actual: 3


[warning] 79-79:
Expected: 1; Actual: 3


[warning] 85-85:
Expected: 1; Actual: 3


[warning] 92-92:
Expected: 1; Actual: 3


[warning] 93-93:
Expected: 1; Actual: 3


[warning] 94-94:
Expected: 1; Actual: 3


[warning] 106-106:
Expected: 1; Actual: 3


[warning] 110-110:
Expected: 1; Actual: 3

πŸ“œ Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 7f45230 and 2e5ecb9.

β›” Files ignored due to path filters (1)
  • composer.lock is excluded by !**/*.lock
πŸ“’ Files selected for processing (3)
  • CONTRIBUTING.md (1 hunks)
  • README.md (2 hunks)
  • composer.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • README.md
🧰 Additional context used
πŸͺ› Markdownlint (0.37.0)
CONTRIBUTING.md

80-80: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

πŸͺ› GitHub Check: Markdownlint (reported by Codacy)
CONTRIBUTING.md

[warning] 9-9:
Expected: 1; Actual: 3


[warning] 10-10:
Expected: 1; Actual: 3


[warning] 11-11:
Expected: 1; Actual: 3


[warning] 21-21:
Expected: 1; Actual: 3


[warning] 22-22:
Expected: 1; Actual: 3


[warning] 26-26:
Expected: 1; Actual: 3


[warning] 27-27:
Expected: 1; Actual: 3


[warning] 28-28:
Expected: 1; Actual: 3


[warning] 29-29:
Expected: 1; Actual: 3


[warning] 35-35:
Expected: 1; Actual: 3


[warning] 36-36:
Expected: 1; Actual: 3


[warning] 40-40:
Expected: 1; Actual: 3


[warning] 41-41:
Expected: 1; Actual: 3


[warning] 42-42:
Expected: 1; Actual: 3


[warning] 69-69:
Expected: 1; Actual: 3


[warning] 70-70:
Expected: 1; Actual: 3


[warning] 71-71:
Expected: 1; Actual: 3


[warning] 78-78:
Expected: 1; Actual: 3


[warning] 79-79:
Expected: 1; Actual: 3


[warning] 85-85:
Expected: 1; Actual: 3


[warning] 92-92:
Expected: 1; Actual: 3


[warning] 93-93:
Expected: 1; Actual: 3


[warning] 94-94:
Expected: 1; Actual: 3


[warning] 106-106:
Expected: 1; Actual: 3


[warning] 110-110:
Expected: 1; Actual: 3

πŸ”‡ Additional comments (3)
composer.json (2)

28-28: LGTM: PHPUnit Version Update

The PHPUnit version update to ^11.5 aligns correctly with the new PHP 8.2 requirement.


24-25: Breaking Change: PHP Version Requirement

The upgrade from PHP 7.4 to 8.2 is a significant breaking change that will affect users. This change:

  • Requires users to upgrade their PHP installations
  • May require code modifications to support PHP 8.2 features
  • Aligns with modern PHP practices and security updates

Moving ext-curl to production requirements is appropriate since it's needed for core functionality.

Let's verify the PHP version compatibility across the codebase:

βœ… Verification successful

PHP 8.2 Upgrade is Safe to Proceed

After analyzing the codebase, the upgrade to PHP 8.2 appears safe as:

  • The code already uses PHP 8.0+ features like typed properties (private string $baseUrl)
  • Uses modern PHP practices like nullable types (public ?string $ip)
  • Employs arrow functions (fn ($ipData) => IpQueryResponse::fromArray($ipData))
  • No deprecated PHP 7.x features were found
  • Test suite is modern and compatible with PHPUnit 11.5

The codebase is well-structured and already follows PHP 8.x coding standards. The ext-curl requirement is correctly placed as it's used in core functionality (makeRequest method).

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for any PHP 7.x specific syntax that might need updates
rg -g '*.php' '\b(list|array)\s*\(' .

Length of output: 39


Script:

#!/bin/bash
# Let's try a different approach to check PHP compatibility issues

# Check for PHP 7.x specific features and syntax
rg -g '*.php' 'list\s*\(.*\)\s*=|yield\s+from|define\s*\(\s*[\'"]\w+[\'"]\s*,\s*\[' .

# Check for nullable type declarations (PHP 7.1+)
rg -g '*.php' '\?\s*(string|int|float|bool|array|callable)\s+\$' .

# Check for return type declarations
rg -g '*.php' ':\s*(string|int|float|bool|array|callable|void)\s*\{' .

# Check for PHP 8.x features that might be used
rg -g '*.php' '(match|enum|readonly|constructor)\s*[\({\s]' .

# Check for class property type declarations
rg -g '*.php' '(private|protected|public)\s+(string|int|float|bool|array)\s+\$' .

Length of output: 249


Script:

#!/bin/bash
# Let's try simpler patterns to check PHP compatibility

# Look for PHP 8.x features
rg -g "*.php" "readonly class|enum class|match \(|#\[.*\]" .

# Look for constructor property promotion
rg -g "*.php" "public function __construct\(.*private.*\)" .

# Look for union types (PHP 8.0+)
rg -g "*.php" ":\s*\w+\|\w+" .

# Look for named arguments (PHP 8.0+)
rg -g "*.php" "\w+:\s*\$\w+" .

# Look for basic file structure and PHP version comments
rg -g "*.php" "^<\?php" -l

Length of output: 597


Script:

#!/bin/bash
# Let's examine the actual PHP code to check for compatibility issues

# Check a sample of PHP files for their content
echo "=== Checking IpQueryClient.php ==="
cat src/IpQueryClient.php

echo -e "\n=== Checking Response/IpQueryResponse.php ==="
cat src/Response/IpQueryResponse.php

echo -e "\n=== Checking tests/IpQueryClientTest.php ==="
cat tests/IpQueryClientTest.php

Length of output: 6621

CONTRIBUTING.md (1)

9-11: LGTM: Requirements Section Update

The requirements section accurately reflects the updated PHP and PHPUnit versions from composer.json.

🧰 Tools
πŸͺ› GitHub Check: Markdownlint (reported by Codacy)

[warning] 9-9:
Expected: 1; Actual: 3


[warning] 10-10:
Expected: 1; Actual: 3


[warning] 11-11:
Expected: 1; Actual: 3

@guibranco guibranco merged commit 8b19606 into main Dec 25, 2024
31 of 33 checks passed
@guibranco guibranco deleted the chore/rename-client-to-ip-query-client branch December 25, 2024 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
β˜‘οΈ auto-merge Automatic merging of pull requests (gstraccini-bot) size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant