# monei/7.2.2/src/Services/BlockSupportService.php

MONEI Payments for WooCommerce, version 7.2.2. 32 lines.

- Page: https://pluginprobe.com/plugins/monei/7.2.2/code/src/Services/BlockSupportService.php
- Raw: https://pluginprobe.com/plugins/monei/7.2.2/raw/src/Services/BlockSupportService.php
- Modified: 2025-02-18T16:56:22+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/monei/7.2.2/code/src/Services/BlockSupportService.php#L10-L20`.

```php
<?php

namespace Monei\Services;

class BlockSupportService {
	private string $blocksPath;
	private string $namespacePrefix;

	public function __construct( string $blocksPath, string $namespacePrefix ) {
		$this->blocksPath      = $blocksPath;
		$this->namespacePrefix = $namespacePrefix;
	}

	/**
	 * Discover and return all block support classes.
	 *
	 * @return string[] List of fully qualified class names.
	 */
	public function getBlockSupportClasses(): array {
		$blockSupportClasses = array();

		foreach ( glob( $this->blocksPath . '/*BlocksSupport.php' ) as $file ) {
			$className = $this->namespacePrefix . pathinfo( $file, PATHINFO_FILENAME );
			if ( class_exists( $className ) ) {
				$blockSupportClasses[] = $className;
			}
		}

		return $blockSupportClasses;
	}
}

```
