Created
August 31, 2025 22:49
-
-
Save mcsee/79cc8eab9b0548e387957c6ae99d6dfd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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