<commit_before><?php

namespace AdobeConnectClient\Commands;

use AdobeConnectClient\Command;
use AdobeConnectClient\Client;
use AdobeConnectClient\SCORecord;
use AdobeConnectClient\Converter\Converter;
use AdobeConnectClient\Helpers\StatusValidate;
use AdobeConnectClient\Helpers\SetEntityAttributes as FillObject;

/**
 * Provides a list of recordings (FLV and MP4) for a specified folder or SCO
 *
 * @link https://helpx.adobe.com/adobe-connect/webservices/list-recordings.html
 */
class ListRecordings extends Command
{
    /** @var int */
    protected $folderId;

    /**
     * @param Client $client
     * @param int $folderId
     */
    public function __construct(Client $client, $folderId)
    {
        parent::__construct($client);
        $this->folderId = (int) $folderId;
    }

    /**
     * @return SCORecord[]
     */
    public function execute()
    {
        $response = Converter::convert(
            $this->client->getConnection()->get([
                'folder-id' => $this->folderId,
                'session' => $this->client->getSession()
            ])
        );

        StatusValidate::validate($response['status']);

        $recordings = [];

        foreach ($response['recordings'] as $recordingAttributes) {
            $scoRecording = new SCORecord();
            FillObject::setAttributes($scoRecording, $recordingAttributes);
            $recordings[] = $scoRecording;
        }<commit_msg>Fix and test the ListRecordings command<commit_after><?php

namespace AdobeConnectClient\Commands;

use AdobeConnectClient\Command;
use AdobeConnectClient\Client;
use AdobeConnectClient\SCORecord;
use AdobeConnectClient\Converter\Converter;
use AdobeConnectClient\Helpers\StatusValidate;
use AdobeConnectClient\Helpers\SetEntityAttributes as FillObject;

/**
 * Provides a list of recordings (FLV and MP4) for a specified folder or SCO
 *
 * @link https://helpx.adobe.com/adobe-connect/webservices/list-recordings.html
 */
class ListRecordings extends Command
{
    /** @var int */
    protected $folderId;

    /**
     * @param Client $client
     * @param int $folderId
     */
    public function __construct(Client $client, $folderId)
    {
        parent::__construct($client);
        $this->folderId = (int) $folderId;
    }

    /**
     * @return SCORecord[]
     */
    public function execute()
    {
        $response = Converter::convert(
            $this->client->getConnection()->get([
                'action' => 'list-recordings',
                'folder-id' => $this->folderId,
                'session' => $this->client->getSession()
            ])
        );

        StatusValidate::validate($response['status']);

        $recordings = [];

        foreach ($response['recordings'] as $recordingAttributes) {
            $scoRecording = new SCORecord();
            FillObject::setAttributes($scoRecording, $recordingAttributes);
            $recordings[] = $scoRecording;
        }
{'fraction_non_alphanumeric': 0.12589316093909492, 'fraction_numerical': 0.0006805035726437564, 'mean_word_length': 2.788659793814433, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 22, 'https://': 2, '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': '7225796', 'n_tokens_mistral': 837, 'n_tokens_neox': 816, 'n_words': 169}