Get a key value from a JSON asset in PHP
I assume that $block-&gt;tweet-&gt;one() returns an Asset element in your matrix block called tweet. I suggest that you use the getContents() method on Craft's Asset element type to retrieve the string content of the actual file. Your code block would look something like this:
case 'tweet':
  $tweetFileContent = $block-&gt;tweet-&gt;one()-&gt;getContents();
  $tweetJson = json_decode($tweetFileContent, true);
  $tweetUrl = $tweetJson['url'];

  if ($tweetUrl) {
    $components[] = [
      'role' =&gt; 'tweet',
      'layout' =&gt; 'tweetLayout',
      'URL' =&gt; $tweetUrl,
    ];
  }
break;

However, I would recommend extending your code as follows to address empty state and potential exception:
case 'tweet':
  if (empty($block-&gt;tweet)) {
    // return early or do something else
  }
  try {
    $tweetFileContent = $block-&gt;tweet-&gt;one()-&gt;getContents();
    $tweetJson = json_decode($tweetFileContent, true);
    $tweetUrl = $tweetJson['url'];

    if ($tweetUrl) {
      $components[] = [
        'role' =&gt; 'tweet',
        'layout' =&gt; 'tweetLayout',
        'URL' =&gt; $tweetUrl,
      ];
    }
  } catch ($e) {
    // getContents() throws 
    // InvalidConfigException if [[volumeId]] is missing or invalid,
    // AssetException if a stream could not be created
  }
break;