0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 3.144.1.100


Current Path : /var/www/oasis/aws/Aws/Arn/
Upload File :
Current File : //var/www/oasis/aws/Aws/Arn/ResourceTypeAndIdTrait.php

<?php
namespace Aws\Arn;

/**
 * @internal
 */
trait ResourceTypeAndIdTrait
{
    public function getResourceType()
    {
        return $this->data['resource_type'];
    }

    public function getResourceId()
    {
        return $this->data['resource_id'];
    }

    private static function parseResourceTypeAndId(array $data)
    {
        $data['resource_type'] = null;
        $data['resource_id'] = null;
        $length = strlen($data['resource']);
        for ($i = 0; $i < $length; $i++) {
            if (in_array($data['resource'][$i], ['/', ':'])) {
                $data['resource_type'] = substr($data['resource'], 0, $i);
                $data['resource_id'] = substr($data['resource'], $i + 1);
                break;
            }
        }

        return $data;
    }
}