<commit_before><?php
namespace Baghayi;

use Baghayi\Collection\Users;
use Baghayi\Request;
use Baghayi\User;

final class Room {

    private $id;
    private $request;

    public function __construct(Request $request, int $roomId)
    {
        $this->id = $roomId;
        $this->request = $request;
    }

    public function id() : int
    {
        return $this->id;
    }

    public function users() : Users
    {
        $result = $this->request->make('getRoomUsers', [
            'room_id' => $this->id,
        ]);

        $users = new Users();
        $users->setRoomId($this->id);
        $users->setRequest($this->request);

        array_map(function($user) use ($users) {
            $users[] = User::fromArray($user);
        }, $result);

        return $users;

        return $users;
    }

    public function url(bool $relative = false) : string
    {
        return $this->request->make('getRoomUrl', [
            'room_id' => $this->id,
            'relative' => $relative,
        ]);
    }
}<commit_msg>update a room however you can<commit_after><?php
namespace Baghayi;

use Baghayi\Collection\Users;
use Baghayi\Request;
use Baghayi\User;

final class Room {

    private $id;
    private $request;

    public function __construct(Request $request, int $roomId)
    {
        $this->id = $roomId;
        $this->request = $request;
    }

    public function id() : int
    {
        return $this->id;
    }

    public function users() : Users
    {
        $result = $this->request->make('getRoomUsers', [
            'room_id' => $this->id,
        ]);

        $users = new Users();
        $users->setRoomId($this->id);
        $users->setRequest($this->request);

        array_map(function($user) use ($users) {
            $users[] = User::fromArray($user);
        }, $result);

        return $users;

        return $users;
    }

    public function url(bool $relative = false) : string
    {
        return $this->request->make('getRoomUrl', [
            'room_id' => $this->id,
            'relative' => $relative,
        ]);
    }

    public function update(array $data)
    {
        return $this->request->make('updateRoom', array_merge($data, ['room_id' => $this->id]));
    }
}
{'fraction_non_alphanumeric': 0.15546594982078854, 'fraction_numerical': 0.0, 'mean_word_length': 2.1100278551532035, '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': '7350993', 'n_tokens_mistral': 705, 'n_tokens_neox': 680, 'n_words': 148}