diff options
author | Peter Kokot <peterkokot@gmail.com> | 2018-10-14 12:55:24 +0200 |
---|---|---|
committer | Peter Kokot <peterkokot@gmail.com> | 2018-10-14 12:55:24 +0200 |
commit | 1c850bfcca97e0456a716a1889b5cf6c5e477cd8 (patch) | |
tree | 8abc7ddda8e988ba248eefdf3ef05923b7383fbd /ext/zip | |
parent | a6d3e56a1ee33f113ee0088b208b2f1bab82c551 (diff) | |
download | php-git-1c850bfcca97e0456a716a1889b5cf6c5e477cd8.tar.gz |
Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.
According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.
C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."
Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.
[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
Diffstat (limited to 'ext/zip')
-rw-r--r-- | ext/zip/examples/addglob.php | 1 | ||||
-rw-r--r-- | ext/zip/examples/addpattern.php | 1 | ||||
-rw-r--r-- | ext/zip/examples/encryption.php | 1 | ||||
-rw-r--r-- | ext/zip/examples/fopen.php | 2 | ||||
-rw-r--r-- | ext/zip/examples/get_set_comments.php | 1 | ||||
-rw-r--r-- | ext/zip/examples/im.php | 1 | ||||
-rw-r--r-- | ext/zip/tests/bug38943.inc | 1 |
7 files changed, 0 insertions, 8 deletions
diff --git a/ext/zip/examples/addglob.php b/ext/zip/examples/addglob.php index 790312b4d5..3c432f0be5 100644 --- a/ext/zip/examples/addglob.php +++ b/ext/zip/examples/addglob.php @@ -11,4 +11,3 @@ $options = array( $found = $z->addGlob("/home/pierre/cvs/gd/libgd/tests/*.png", 0, $options); var_dump($found); $z->close(); - diff --git a/ext/zip/examples/addpattern.php b/ext/zip/examples/addpattern.php index a1a9b12291..41efaa5eb7 100644 --- a/ext/zip/examples/addpattern.php +++ b/ext/zip/examples/addpattern.php @@ -10,4 +10,3 @@ $options = array('remove_path' => '/home/pierre/cvs/gd/libgd/tests', $found = $z->addPattern("/(\.png)$/i", "/home/pierre/cvs/gd/libgd/tests", $options); var_dump($found); $z->close(); - diff --git a/ext/zip/examples/encryption.php b/ext/zip/examples/encryption.php index 69888170a9..9ef7dd8497 100644 --- a/ext/zip/examples/encryption.php +++ b/ext/zip/examples/encryption.php @@ -46,4 +46,3 @@ $ctx = stream_context_create(array( )); $text = file_get_contents("zip://$name#$file", false, $ctx); printf("Size = %d\n", strlen($text)); - diff --git a/ext/zip/examples/fopen.php b/ext/zip/examples/fopen.php index 32357f3c08..80de5d052a 100644 --- a/ext/zip/examples/fopen.php +++ b/ext/zip/examples/fopen.php @@ -31,5 +31,3 @@ while (!feof($fp)) { fclose($fp); file_put_contents('t',$contents); echo "done.\n"; - - diff --git a/ext/zip/examples/get_set_comments.php b/ext/zip/examples/get_set_comments.php index 5bd302e6da..bec4240246 100644 --- a/ext/zip/examples/get_set_comments.php +++ b/ext/zip/examples/get_set_comments.php @@ -35,4 +35,3 @@ echo $z->getCommentName('foobar/', ZIPARCHIVE::FL_UNCHANGED) . "\n"; echo "Archive comment: " . $z->getArchiveComment() . "\n"; echo "Archive comment (original): " . $z->getArchiveComment(ZIPARCHIVE::FL_UNCHANGED) . "\n"; - diff --git a/ext/zip/examples/im.php b/ext/zip/examples/im.php index e954576ad6..6a35e31242 100644 --- a/ext/zip/examples/im.php +++ b/ext/zip/examples/im.php @@ -8,4 +8,3 @@ $z->open(dirname(__FILE__) . '/test_im.zip'); $im_string = $z->getFromName("pear_item.gif"); $im = imagecreatefromstring($im_string); imagepng($im, 'b.png'); - diff --git a/ext/zip/tests/bug38943.inc b/ext/zip/tests/bug38943.inc index a6f45e8294..b439939e64 100644 --- a/ext/zip/tests/bug38943.inc +++ b/ext/zip/tests/bug38943.inc @@ -13,4 +13,3 @@ class myZip extends ZipArchive { $z = new myZip; $z->testp = "foobar"; var_dump($z); - |