Skip to content

Conversation

@benwerd
Copy link
Member

@benwerd benwerd commented Sep 6, 2025

Here's what I fixed or added:

  • Idno\Common\Page::getInput: Refactored input retrieval logic to clarify precedence (request > JSON payload > default) and ensure filters are applied correctly, fixing a minor bug.
  • Idno\Core\Idno::componentFactory: Simplified the factory method to reduce branching, consolidate class existence and subclass validation, and handle default class instantiation more consistently.
  • Idno\Core\Config: Streamlined several boolean and string return helpers (getTitle, getDescription, isPublicSite, multipleSyndicationAccounts, isDefaultConfig) using null coalescing and direct boolean casts.
  • Idno\Core\Service: Extracted URL normalization logic into a new private helper method normalizeUrlForToken and reused it in generateToken to deduplicate code.

Here's why I did it:

The primary goal was to simplify and clarify code within the Idno\Core and Idno\Common namespaces, as requested. This refactoring addresses areas of complexity, reduces redundant logic, improves readability, and fixes a minor bug in Page::getInput, making the codebase more maintainable and easier to understand.

Checklist: ([x] to check/tick the boxes)

  • This pull request addresses a single issue
  • If this code includes interface changes, I've included screenshots in this Pull Request thread
  • I've adhered to Known's style guide (these codesniffer rules might help!)
  • My git branch is named in a descriptive way - i.e., yourname-summary-of-issue
  • I've tested my code in-browser
  • My code contains descriptive comments
  • I've added tests where applicable, and...
  • I can run the unit tests successfully.

Open in Cursor Open in Web

Co-authored-by: ben <ben@benwerd.com>
@cursor
Copy link

cursor bot commented Sep 6, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

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