# code-snippets/4.0.0-beta.1/php/flat-files/handlers/php-snippet-handler.php

Code Snippets, version 4.0.0-beta.1. 19 lines.

- Page: https://pluginprobe.com/plugins/code-snippets/4.0.0-beta.1/code/php/flat-files/handlers/php-snippet-handler.php
- Raw: https://pluginprobe.com/plugins/code-snippets/4.0.0-beta.1/raw/php/flat-files/handlers/php-snippet-handler.php
- Modified: 2025-10-31T14:18:56+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/code-snippets/4.0.0-beta.1/code/php/flat-files/handlers/php-snippet-handler.php#L10-L20`.

```php
<?php

namespace Code_Snippets;

class Php_Snippet_Handler implements Snippet_Type_Handler_Interface {
	public function get_file_extension(): string {
		return 'php';
	}

	public function get_dir_name(): string {
		return 'php';
	}

	public function wrap_code( string $code ): string {
		$output = "<?php\n\n" . apply_filters( 'code_snippets_php_snippet_file_code', $code );
		return $output;
	}
}

```
