<commit_before><?php
    require_once 'models/follow.php';
    class FollowController extends ControllerBase {
        public function create( $followedid ) {
            if ( !isset( $_SESSION[ 'user' ] ) ) {
                throw new HTTPUnauthorizedException();
            }

            $followedid = intval( $followedid );
            $follower = $_SESSION[ 'user' ];
            $followed = new User( $followedid );
            $follow = new Follow();
            $follow->follower = $follower;
            $follow->followed = $followed;
            $follow->save();
            go( 'user', 'view', [ 'username' => $followed->username ] );
        }

        public function delete( $followedid ) {
            if ( !isset( $_SESSION[ 'user' ] ) ) {
                throw new HTTPUnauthorizedException();
            }

            $followerid = $_SESSION[ 'user' ]->id;
            $followedid = intval( $followedid );
            $follow = new Follow( $followerid, $followedid );
            $follower = $follow->follower;
            $followed = $follow->followed;<commit_msg>Take advantage of weak types<commit_after><?php
    require_once 'models/follow.php';
    class FollowController extends ControllerBase {
        public function create( $followedid ) {
            if ( !isset( $_SESSION[ 'user' ] ) ) {
                throw new HTTPUnauthorizedException();
            }

            $followedid = $followedid;
            $follower = $_SESSION[ 'user' ];
            $followed = new User( $followedid );
            $follow = new Follow();
            $follow->follower = $follower;
            $follow->followed = $followed;
            $follow->save();
            go( 'user', 'view', [ 'username' => $followed->username ] );
        }

        public function delete( $followedid ) {
            if ( !isset( $_SESSION[ 'user' ] ) ) {
                throw new HTTPUnauthorizedException();
            }

            $followerid = $_SESSION[ 'user' ]->id;
            $followedid = $followedid;
            $follow = new Follow( $followerid, $followedid );
            $follower = $follow->follower;
            $followed = $follow->followed;
{'fraction_non_alphanumeric': 0.13382556529764653, 'fraction_numerical': 0.0, 'mean_word_length': 1.8119325551232166, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4588249', 'n_tokens_mistral': 607, 'n_tokens_neox': 583, 'n_words': 137}