<commit_before><?php

namespace App\Events\Api\Building;

use App\Events\Event;
use App\Http\Models\API\Building;
use Illuminate\Support\Facades\Log;

class BuildingUpdated extends Event
{


    public function __construct(Building $building)
    {
        Log::info('Building Updated:', [
            'id' => $building->id,
            'code' => $building->code,
            'label' => $building->label
        ]);

        if (auth()->user()) {

            $building->campus;

            $data_to_secure = json_encode([
                'data' => $building->toArray(),
                'conf' => [
                    'ldap' => ldap_config()
                ]
            ]);

            $secure_data = encrypt_broadcast_data($data_to_secure);

            $message = [
                'event' => 'updated',
                'type' => 'building',
                'encrypted' => $secure_data
            ];

            Redis::publish('events', json_encode($message));

            history()->log(
                'Building',
                'updated the building: ' . $building->label() . '.',
                $building->id,
                'building',
                'bg-lime'
            );
        }
    }
}
<commit_msg>BuildingUpdated constructor comment.<commit_after><?php

namespace App\Events\Api\Building;

use App\Events\Event;
use App\Http\Models\API\Building;
use Illuminate\Support\Facades\Log;

class BuildingUpdated extends Event
{

    /**
     * BuildingUpdated constructor.
     * @param Building $building
     */
    public function __construct(Building $building)
    {
        Log::info('Building Updated:', [
            'id' => $building->id,
            'code' => $building->code,
            'label' => $building->label
        ]);

        if (auth()->user()) {

            $building->campus;

            $data_to_secure = json_encode([
                'data' => $building->toArray(),
                'conf' => [
                    'ldap' => ldap_config()
                ]
            ]);

            $secure_data = encrypt_broadcast_data($data_to_secure);

            $message = [
                'event' => 'updated',
                'type' => 'building',
                'encrypted' => $secure_data
            ];

            Redis::publish('events', json_encode($message));

            history()->log(
                'Building',
                'updated the building: ' . $building->label() . '.',
                $building->id,
                'building',
                'bg-lime'
            );
        }
    }
}

{'fraction_non_alphanumeric': 0.1449785072293865, 'fraction_numerical': 0.0, 'mean_word_length': 1.4474187380497132, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 39, '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': '1448678', 'n_tokens_mistral': 721, 'n_tokens_neox': 672, 'n_words': 117}