Skip to content

Instantly share code, notes, and snippets.

@mcsee
Created August 31, 2025 22:49
Show Gist options
  • Save mcsee/79cc8eab9b0548e387957c6ae99d6dfd to your computer and use it in GitHub Desktop.
Save mcsee/79cc8eab9b0548e387957c6ae99d6dfd to your computer and use it in GitHub Desktop.
<?php
class UserService {
// Step 1: Identified annotations
// (@author, @version, @description,
// Step 2: Evaluated their purpose
// (metadata, deprecated, todo notes)
// Step 3: Removed unnecessary annotations (no value added)
// Step 4: Replaced critical annotations
// with explicit code (none needed)
// Type hintings are explicit
public function userName(int $id): string {
$statement = $this->database->prepare(
"SELECT name FROM users WHERE id = ?");
// No tech debt
$statement->execute([$id]);
return $statement->fetchColumn();
// You can add a test to ensure there are
// no new calls to this deprecated method
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment