# imagify/1.9.13/classes/WriteFile/WriteFileInterface.php

Imagify Image Optimization: Optimize Images | Compress &amp; Convert to WebP/AVIF, version 1.9.13. 69 lines.

- Page: https://pluginprobe.com/plugins/imagify/1.9.13/code/classes/WriteFile/WriteFileInterface.php
- Raw: https://pluginprobe.com/plugins/imagify/1.9.13/raw/classes/WriteFile/WriteFileInterface.php
- Modified: 2019-05-06T14:27: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/imagify/1.9.13/code/classes/WriteFile/WriteFileInterface.php#L10-L20`.

```php
<?php
namespace Imagify\WriteFile;

defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );

/**
 * Interface to add and remove contents to a file.
 *
 * @since  1.9
 * @author Grégory Viguier
 */
interface WriteFileInterface {

	/**
	 * Add new contents to the file.
	 *
	 * @since  1.9
	 * @access public
	 * @author Grégory Viguier
	 *
	 * @return bool|\WP_Error True on success. A \WP_Error object on error.
	 */
	public function add();

	/**
	 * Remove the related contents from the file.
	 *
	 * @since  1.9
	 * @access public
	 * @author Grégory Viguier
	 *
	 * @return bool|\WP_Error True on success. A \WP_Error object on error.
	 */
	public function remove();

	/**
	 * Get the path to the file.
	 *
	 * @since  1.9
	 * @access public
	 * @author Grégory Viguier
	 *
	 * @return string
	 */
	public function get_file_path();

	/**
	 * Tell if the file is writable.
	 *
	 * @since  1.9
	 * @access public
	 * @author Grégory Viguier
	 *
	 * @return bool|\WP_Error True if writable. A \WP_Error object if not.
	 */
	public function is_file_writable();

	/**
	 * Get new contents to write into the file.
	 *
	 * @since  1.9
	 * @access public
	 * @author Grégory Viguier
	 *
	 * @return string
	 */
	public function get_new_contents();
}

```
