<commit_before><?php
namespace wiggum\services\storage\adapters;

use \wiggum\services\storage\StorageAdapter;
use \League\Flysystem\Filesystem;
use \League\Flysystem\AwsS3V3\AwsS3V3Adapter;
use \Aws\S3\S3Client;

class AwsS3Adapter extends StorageAdapter {

    /**
     *
     * @param array $config
     * @return Filesystem
     */
    public function getFilesystem(array $config): Filesystem
    {
        $options = [
            'endpoint' => $config['endpoint'],
            'region' => $config['region'],
            'credentials' => [
                'key' => $config['key'],
                'secret' => $config['secret']
            ],
            'version' => $config['version']
        ];

        $client = new S3Client($options);

        // The internal adapter
        $adapter = new AwsS3V3Adapter(
            // S3Client
            $client,
            // Bucket name
            $config['bucket']
        );

        // The FilesystemOperator
        return new Filesystem($adapter);
    }

}<commit_msg>Update AwsS3Adapter.php<commit_after><?php
namespace wiggum\services\storage\adapters;

use \wiggum\services\storage\StorageAdapter;
use \League\Flysystem\Filesystem;
use \League\Flysystem\AwsS3V3\AwsS3V3Adapter;
use \Aws\S3\S3Client;

class AwsS3Adapter extends StorageAdapter {

    /**
     *
     * @param array $config
     * @return Filesystem
     */
    public function getFilesystem(array $config): Filesystem
    {
        $client = new S3Client($config);

        // The internal adapter
        $adapter = new AwsS3V3Adapter(
            // S3Client
            $client,
            // Bucket name
            $config['bucket']
        );

        // The FilesystemOperator
        return new Filesystem($adapter);
    }

}

{'fraction_non_alphanumeric': 0.12088535754824063, 'fraction_numerical': 0.013053348467650397, 'mean_word_length': 2.018835616438356, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '4610546', 'n_tokens_mistral': 539, 'n_tokens_neox': 523, 'n_words': 101}