Skip to content

Remove carbon dependency - not needed#99

Merged
yeu1 merged 1 commit into
masterfrom
remove-carbon
May 6, 2026
Merged

Remove carbon dependency - not needed#99
yeu1 merged 1 commit into
masterfrom
remove-carbon

Conversation

@yeu1

@yeu1 yeu1 commented May 5, 2026

Copy link
Copy Markdown
Contributor

Carbon is not needed in this library

@coderabbitai

coderabbitai Bot commented May 5, 2026

Copy link
Copy Markdown

Walkthrough

The pull request removes the nesbot/carbon dependency and replaces all Carbon-based time operations with native PHP DateTimeImmutable and time() functions. The composer.json file is updated to remove the dependency. Source files (OAuthApi, PenneoTokensValidator) are modified to use time() and DateTimeImmutable for timestamp operations. Unused imports from various classes are removed. The OAuthApi constructor is extended to accept an optional callable $nowFactory parameter for time control. Test files are updated to use DateTimeImmutable instead of Carbon for time manipulation, with helper methods added to manage timestamp calculations. The CHANGELOG.md is updated with version 3.1.1 documentation.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description is brief but directly related to the changeset, stating that Carbon is not needed in the library.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title directly and clearly describes the main objective of the changeset: removing the Carbon dependency.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@yeu1 yeu1 requested a review from HeadCookie May 5, 2026 18:51

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CHANGELOG.md`:
- Around line 11-12: The changelog entry currently under the "### Added" header
is incorrect: split the line "Removed nesbot/carbon dependency; OAuth timestamps
use native `DateTimeImmutable` / `time()`." into two entries and place them
under the proper headers — move "Removed nesbot/carbon dependency" under a "###
Removed" section and place "OAuth timestamps use native `DateTimeImmutable` /
`time()`" under a "### Changed" section, ensuring the original "### Added"
header no longer contains this line and that spacing/markdown consistency
matches surrounding entries.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 6f32e3f8-bf80-4241-bf79-42000b0ceff5

📥 Commits

Reviewing files that changed from the base of the PR and between 2d4bb18 and 9befa4e.

📒 Files selected for processing (13)
  • CHANGELOG.md
  • composer.json
  • src/Message.php
  • src/OAuth/ApiKeysMiddleware.php
  • src/OAuth/OAuthApi.php
  • src/OAuth/Tokens/PenneoTokensValidator.php
  • src/Validation.php
  • src/WebhookSubscription.php
  • tests/unit/OAuth/OAuth/ApiKeysMiddlewareTest.php
  • tests/unit/OAuth/OAuth/IsAuthorizedTest.php
  • tests/unit/OAuth/OAuth/RefreshTokenMiddlewareTest.php
  • tests/unit/OAuth/OAuthApiTest.php
  • tests/unit/OAuth/PenneoTokensValidatorTest.php
💤 Files with no reviewable changes (6)
  • tests/unit/OAuth/OAuth/IsAuthorizedTest.php
  • src/Message.php
  • src/OAuth/ApiKeysMiddleware.php
  • src/WebhookSubscription.php
  • composer.json
  • src/Validation.php

Comment thread CHANGELOG.md
Comment on lines +11 to +12
### Added
- Removed nesbot/carbon dependency; OAuth timestamps use native `DateTimeImmutable` / `time()`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use the correct changelog category for this entry.

Line 11 uses ### Added, but Line 12 describes a dependency removal plus behavior change. Please move/split this into ### Removed and ### Changed for accurate release notes.

Suggested changelog adjustment
-### Added
-- Removed nesbot/carbon dependency; OAuth timestamps use native `DateTimeImmutable` / `time()`.
+### Changed
+- OAuth timestamps now use native `DateTimeImmutable` / `time()`.
+
+### Removed
+- Removed `nesbot/carbon` dependency.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
### Added
- Removed nesbot/carbon dependency; OAuth timestamps use native `DateTimeImmutable` / `time()`.
### Changed
- OAuth timestamps now use native `DateTimeImmutable` / `time()`.
### Removed
- Removed `nesbot/carbon` dependency.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CHANGELOG.md` around lines 11 - 12, The changelog entry currently under the
"### Added" header is incorrect: split the line "Removed nesbot/carbon
dependency; OAuth timestamps use native `DateTimeImmutable` / `time()`." into
two entries and place them under the proper headers — move "Removed
nesbot/carbon dependency" under a "### Removed" section and place "OAuth
timestamps use native `DateTimeImmutable` / `time()`" under a "### Changed"
section, ensuring the original "### Added" header no longer contains this line
and that spacing/markdown consistency matches surrounding entries.

@yeu1 yeu1 changed the title Remove carbon dependency - it is not needed Remove carbon dependency - not needed May 6, 2026

@sorinpuncea sorinpuncea left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ok

@yeu1 yeu1 merged commit 80650fa into master May 6, 2026
19 checks passed
@yeu1 yeu1 deleted the remove-carbon branch May 6, 2026 08:27
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.

2 participants