Skip to content

Correction: Remove unintentionally created files#37

Merged
james2037 merged 2 commits into
masterfrom
fix/blobresource-toarray-coverage
Jun 4, 2025
Merged

Correction: Remove unintentionally created files#37
james2037 merged 2 commits into
masterfrom
fix/blobresource-toarray-coverage

Conversation

@james2037

Copy link
Copy Markdown
Owner

Removes FileReaderTool.php and FileReaderToolTest.php which were created unintentionally in a previous step and should not have been included in the prior commit.

This commit cleans up your repository by deleting these superfluous files. All tests continue to pass after their removal.

Removes FileReaderTool.php and FileReaderToolTest.php which were
created unintentionally in a previous step and should not have been
included in the prior commit.

This commit cleans up your repository by deleting these
superfluous files. All tests continue to pass after their removal.
@codecov

codecov Bot commented Jun 4, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

I refactored the `ResourceContents` class and its subclasses
(`TextResourceContents`, `BlobResourceContents`) to use a non-nullable
`mimeType` string property. This change improves type safety and
resolves a PHPStan warning regarding potential nullability issues.

Key changes:
- `ResourceContents::$mimeType` is now `string`.
- `ResourceContents::__construct` now requires a `string $mimeType`.
- `ResourceContents::toArray` now always includes `mimeType`.
- `TextResourceContents::__construct` updated to require `string $mimeType`
  (retaining its default 'text/plain' if no argument is passed).
- `TextResourceContents::toArray` simplified, relies on parent for mimeType.
- `Resource::text()` helper method updated to ensure it passes a
  non-nullable mimeType string to `TextResourceContents` constructor.
- `BlobResourceContents` already aligned with non-nullable mimeType.
- Added `TextResourceContentsTest.php` with tests for its constructor
  and `toArray` method, covering default and explicit mimeTypes.

All PHPCS, PHPStan, and PHPUnit tests pass. The previous PHPStan
issue related to `BlobResourceContents::toArray()` return type is
resolved by these changes.
@github-actions

github-actions Bot commented Jun 4, 2025

Copy link
Copy Markdown

🧪 Test Results Summary

PHPUnit Tests

✅ All tests passed!

Details: OK (197 tests, 846 assertions)

  • Total Tests: 197
  • Total Assertions: 846

Code Quality

  • PHPCS: ✅ No issues
  • PHPStan: ✅ No errors found

📁 Detailed Reports

  • Coverage Report: Download the test-outputs artifact for detailed HTML coverage report
  • Test Results: Check the "Tests" tab above for detailed test results
  • Raw Logs: View the "Actions" tab for complete output logs

This comment will update automatically when you push new commits.

Code Coverage

Code Coverage

Package Line Rate Health
Capability/CapabilityInterface.php 0%
Capability/ResourcesCapability.php 100%
Capability/ToolsCapability.php 100%
Exception/InvalidParamsException.php 0%
Exception/InvalidRequestException.php 0%
Exception/MethodNotSupportedException.php 0%
Exception/TransportException.php 0%
Message/JsonRpcMessage.php 89%
Registry/Registry.php 97%
Resource/Attribute/ResourceUri.php 100%
Resource/BlobResourceContents.php 100%
Resource/Resource.php 100%
Resource/ResourceContents.php 100%
Resource/ResourceRegistry.php 100%
Resource/TextResourceContents.php 100%
Server.php 69%
Tool/Attribute/Parameter.php 100%
Tool/Attribute/Tool.php 100%
Tool/Attribute/ToolAnnotations.php 100%
Tool/Content/AbstractContent.php 100%
Tool/Content/AbstractMediaContent.php 100%
Tool/Content/Annotations.php 100%
Tool/Content/AudioContent.php 100%
Tool/Content/ContentItemInterface.php 0%
Tool/Content/EmbeddedResource.php 100%
Tool/Content/ImageContent.php 100%
Tool/Content/TextContent.php 100%
Tool/Tool.php 84%
Tool/ToolRegistry.php 100%
Transport/AbstractTransport.php 0%
Transport/HttpTransport.php 70%
Transport/StdioTransport.php 96%
Transport/TransportInterface.php 0%
Summary 85% (827 / 975)

@james2037 james2037 merged commit a080331 into master Jun 4, 2025
3 checks passed
@james2037 james2037 deleted the fix/blobresource-toarray-coverage branch June 5, 2025 02:43
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.

1 participant