# ablocks/2.9.1/includes/frontend/dynamic-content/argument-parser.php

aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder &amp; Animation Builder, version 2.9.1. 32 lines.

- Page: https://pluginprobe.com/plugins/ablocks/2.9.1/code/includes/frontend/dynamic-content/argument-parser.php
- Raw: https://pluginprobe.com/plugins/ablocks/2.9.1/raw/includes/frontend/dynamic-content/argument-parser.php
- Modified: 2025-04-22T12:59:06+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/ablocks/2.9.1/code/includes/frontend/dynamic-content/argument-parser.php#L10-L20`.

```php
<?php
namespace ABlocks\Frontend\DynamicContent;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
class ArgumentParser {

	protected array $args;
	protected array $interpreters;
	protected string $arg_str;
	protected bool $is_richtext;
	public function __construct( string $arg_str, bool $is_richtext, array $interpreters ) {
		$this->arg_str = $arg_str;
		$this->is_richtext = $is_richtext;
		$this->interpreters = $interpreters;
	}
	public function interpret() : ?Interpreters\Abstracts\Interpreter {
		$setting = explode( '|', $this->arg_str );
		$action_name = $setting[0];
		array_shift( $setting );

		if ( ! empty( $class = $this->interpreters[ $action_name ] ?? '' ) &&
			class_exists( $class ) &&
			( $ins = new $class( $action_name, $setting, $this->is_richtext ) ) instanceof Interpreters\Abstracts\Interpreter
		) {
			return $ins;
		}
		return null;
	}
}

```
