src/Presets/FilesystemTrait.php
protected function appendUniqueStatement( $filepath, $statement ) {
		$contents = file_get_contents( $filepath );

		if ( $this->stringHasStatement( $contents, $statement ) ) {
			return;
		}

		$eol = $this->getEol( $contents );
		$content_lines = explode( "\n", $contents );
		$last_line = trim( $content_lines[ count( $content_lines ) - 1 ] );

		if ( empty( $last_line ) ) {
			$contents .= $statement . $eol;
		} else {
			$contents .= $eol . $statement;
		}

		file_put_contents( $filepath, $contents );
	}
protected function appendUniqueStatement( $filepath, $statement ) {
		$contents = file_get_contents( $filepath );

		if ( $this->stringHasStatement( $contents, $statement ) ) {
			return;
		}

		$eol = $this->getEol( $contents );
		$content_lines = explode( "\n", $contents );
		$last_line = trim( $content_lines[ count( $content_lines ) - 1 ] );

		if ( empty( $last_line ) ) {
			$contents .= $statement . $eol;
		} else {
			$contents .= $eol . $statement;
		}

		file_put_contents( $filepath, $contents );
	}
protected function appendUniqueStatement ( $ filepath , $ statement ) { $ contents = file_get_contents ( $ filepath ) ; if ( $ this -> stringHasStatement ( $ contents , $ statement ) ) { return ; } $ eol = $ this -> getEol ( $ contents ) ; $ content_lines = explode ( "\n" , $ contents ) ; $ last_line = trim ( $ content_lines [ count ( $ content_lines ) - 1 ] ) ; if ( empty ( $ last_line ) ) { $ contents .= $ statement . $ eol ; } else { $ contents .= $ eol . $ statement ; } file_put_contents ( $ filepath , $ contents ) ; }
Append a statement to file.

@param  string $filepath
@param  string $statement
@return void
Append a statement to file .