Skip to content

Modernizing Codebase with Claude's help#114

Closed
erikaheidi wants to merge 6 commits into
mainfrom
claude-updates
Closed

Modernizing Codebase with Claude's help#114
erikaheidi wants to merge 6 commits into
mainfrom
claude-updates

Conversation

@erikaheidi

@erikaheidi erikaheidi commented Jul 23, 2025

Copy link
Copy Markdown
Member

I am currently evaluating Claude and testing it with different projects to learn how it works. Decided to give it a try here to see if I could modernize to PHP 8.4+, the results are here :) can Copilot do better? I don't know. Let's review the changes.

The full roadmap proposed by Claude Code is available on issue #115

erikaheidi and others added 3 commits July 23, 2025 20:33
- Update composer.json to support PHP 8.4
- Fix implicitly nullable parameter in tests/Pest.php for PHP 8.4 compatibility
- Modernize callable invocation in App.php for better performance

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add magic methods __get, __set, and __isset to handle custom theme styles
- Store custom styles in private array instead of creating dynamic properties
- Eliminates PHP 8.2+ deprecation warning for custom theme styles
- Maintains full backward compatibility with existing theme API

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Improve PHPDoc documentation across App, Config, and DI Container classes
- Add detailed method descriptions explaining delegation patterns and return types
- Enhance type annotations for better IDE support and static analysis
- Update dependency injection container with clearer type expectations
- Maintain backward compatibility while providing better developer experience
- Update composer dependencies to latest stable versions

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

Copilot AI 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.

Pull Request Overview

This PR modernizes the codebase to support PHP 8.4+ by improving type annotations, enhancing documentation, and implementing modern PHP practices. The changes focus on stricter typing, better API design, and cleaner syntax usage.

  • Improved type annotations with nullable types and mixed types for better PHP 8.4 compatibility
  • Enhanced documentation with more descriptive comments and parameter descriptions
  • Added dynamic property support for ThemeConfig class and modernized callable syntax

Reviewed Changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/Pest.php Updated parameter type annotation to use nullable array syntax
src/Output/ThemeConfig.php Added magic methods for dynamic property access with custom styles storage
src/DI/Container.php Updated ArrayAccess method parameter type to mixed
src/Config.php Enhanced documentation and changed setter parameter type to mixed
src/Command/CommandController.php Improved documentation for magic method with return type details
src/App.php Enhanced documentation and modernized callable syntax
composer.json Updated PHP version constraint to include 8.4

Comment thread composer.json Outdated
Comment thread src/Output/ThemeConfig.php
Comment thread src/Output/ThemeConfig.php
erikaheidi and others added 3 commits July 24, 2025 11:06
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Regenerate lock file to match current composer.json constraints
- Ensure consistent dependency versions across environments

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@erikaheidi erikaheidi changed the title [WIP] Modernizing Codebase with Claude's help Modernizing Codebase with Claude's help Jul 24, 2025

@WendellAdriel WendellAdriel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I added a few comments if you want to take a look at them

foreach ($styles as $name => $style) {
$formatted[$name] = ThemeStyle::make(...$style);
}
$formatted = array_map(fn ($style) => ThemeStyle::make(...$style), $styles);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@erikaheidi IDK if I'm getting it wrong, but here I think it's going to create an array without using the $name as the key, what could create some issues

final class ThemeConfig
{
/** @var array<string, ThemeStyle> */
private array $customStyles = [];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's remove this functionality for the custom styles for now

@erikaheidi

Copy link
Copy Markdown
Member Author

This seems a bit messed up, I am going to close the PR and try a smaller update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants