<?php
/**
* UserService.php
*
* 用戶業務邏輯服務層,提供註冊、認證、資料更新等核心功能
*
* @package App\Service
* @author Zhang San <zhangsan@example.com>
* @copyright 2024 Example Corp.
* @license MIT
* @version 2.1.0
* @since 2023-05-15
* @link https://github.com/example/project
*/
| 標籤 | 用途 | 是否必填 |
|---|---|---|
@package | 命名空間/模塊歸屬 | 是 |
@author | 原始作者姓名與郵箱 | 是 |
@copyright | 版權所有者與年份 | 是 |
@license | 開源協議或專有標識 | 是 |
@version | 語義化版本號 | 建議 |
@since | 首次引入版本/日期 | 建議 |
@link | 項目/文檔/工單鏈接 | 可選 |
@deprecated | 棄用說明及替代方案 | 視情況 |
@see | 參考相關類/方法/文檔 | 可選 |
在文件頭註釋末尾或單獨區塊記錄重要變更:
/**
* ...
* @changelog
* 2024-03-10 v2.1.0 Zhang San: 新增 OAuth2 綁定功能 (Issue #456)
* 2024-01-22 v2.0.5 Li Si: 修復密碼重置 Token 重複使用漏洞 (CVE-2024-xxxx)
* 2023-11-01 v2.0.0 Wang Wu: 重構為服務層架構,引入 Repository 模式
*/
<?php
// ... 原代碼 ...
// === MODIFIED 2024-03-10 by Zhang San: Issue #456 新增 OAuth2 綁定 ===
public function bindOAuth(string $provider, string $accessToken): User
{
// 新增邏輯...
}
// === END MODIFIED ===
// ... 後續代碼 ...
LICENSE 文件(MIT/Apache-2.0/GPL-3.0 等)@copyright 與 @license 標籤@license Proprietary 並註明「All rights reserved」PSR12 包含文件頭檢查phpcs --standard=PSR12phpcs 阻斷不合規提交