XF 2 Tip Create XenForo PHP documentation

BattleKing

Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
Joined
May 24, 2020
Messages
3,497
Points
523

Reputation:

XenForo uses PHP DocBloc blocks like



PHP:
       /**
 * COLUMNS
 * @property int|null $user_id
 * @property string $username
 * @property int $username_date
 * @property int $username_date_visible
 * @property string $email
 * @property int $style_id
 * @property int $language_id
 * @property string $timezone
 * @property bool $visible
 * @property bool $activity_visible
 * @property int $user_group_id
 * @property array $secondary_group_ids
 * @property int $display_style_group_id
 * @property int $permission_combination_id_
 * @property int $message_count
 * @property int $question_solution_count
 * @property int $alerts_unviewed
 * @property int $alerts_unread
 * @property int $conversations_unread
 * @property int $register_date
 * @property int $last_activity_
 * @property int|null $last_summary_email_date
 * @property int $trophy_points
 * @property int $avatar_date
 * @property int $avatar_width
 * @property int $avatar_height
 * @property bool $avatar_highdpi
 * @property string $gravatar
 * @property string $user_state
 * @property string $security_lock
 * @property bool $is_moderator
 * @property bool $is_admin
 * @property bool $is_staff
 * @property bool $is_banned
 * @property int $reaction_score
 * @property int $vote_score
 * @property string $custom_title
 * @property int $warning_points
 * @property string $secret_key
 * @property int $privacy_policy_accepted
 * @property int $terms_accepted
 *
 * GETTERS
 * @property \XF\PermissionSet $PermissionSet
 * @property int $permission_combination_id
 * @property bool $is_super_admin
 * @property int $last_activity
 * @property string $email_confirm_key
 * @property int $warning_count
 * @property int $next_allowed_username_change
 *
 * RELATIONS
 * @property \XF\Entity\Admin $Admin
 * @property \XF\Entity\UserAuth $Auth
 * @property \XF\Mvc\Entity\AbstractCollection|\XF\Entity\UserConnectedAccount[] $ConnectedAccounts
 * @property \XF\Entity\UserOption $Option
 * @property \XF\Entity\PermissionCombination $PermissionCombination
 * @property \XF\Entity\UserProfile $Profile
 * @property \XF\Entity\UserPrivacy $Privacy
 * @property \XF\Entity\UserBan $Ban
 * @property \XF\Entity\UserReject $Reject
 * @property \XF\Entity\SessionActivity $Activity
 * @property \XF\Entity\ApprovalQueue $ApprovalQueue
 * @property \XF\Mvc\Entity\AbstractCollection|\XF\Entity\UserFollow[] $Following
 * @property \XF\Entity\UsernameChange $PendingUsernameChange
 * @property \XF\Entity\PreRegAction $PreRegAction
 */
throughout its PHP files to document the software.

IDEs like phpStrom can consume this to provide hinting, etc.

If you do not use an IDE (though this is strongly recommended) and / or you would like to view the documentation in your browsers your can easily build this yourself (after installing phpDocumentor):

phpdoc -d /path/to/XF/src -t /path/to/destination/directory

Take a coffee and wait a few minutes while the command is running.
Afterwards you can access the documentation by pointing your browser to the destination directory.

1657364354668.jpg
 
Top