Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Auto detect text files and perform EOL normalization
* text=auto eol=lf
tests/data/*-win.php eol=crlf
2 changes: 1 addition & 1 deletion php/WP_CLI/DocParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class DocParser {
*/
public function __construct( $docComment ) {
/* Make sure we have a known line ending in document */
$docComment = preg_replace( '/\R/', "\n", $docComment );
$docComment = str_replace( "\r\n", "\n", $docComment );
$this->docComment = self::remove_decorations( $docComment );
}

Expand Down
70 changes: 70 additions & 0 deletions tests/data/commandfactory-doc_comment-class-win.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?php

/**
* Basic class
*
* ## EXAMPLES
*
* # Foo.
* $ wp foo
*/
class CommandFactoryTests_Get_Doc_Comment_1_Command_Win extends WP_CLI_Command {
/**
* Command1 method
*
* ## OPTIONS
*
* ## EXAMPLES
*
* $ wp foo command1 public
*/
function command1() {
}

/**
* Command2 function
*
* ## OPTIONS
*
* [--path=<path>]
*
* ## EXAMPLES
*
* $ wp foo command2 --path=/**a/**b/**c/**
*/

final
protected
static
function
command2() {
}

/**
* Command3 function
*
* ## OPTIONS
*
* [--path=<path>]
*
* ## EXAMPLES
*
* $ wp foo command3 --path=/**a/**b/**c/**
function*/public function command3( $function ) {}

function command4() {}
}

/**
* Basic class
*
* ## EXAMPLES
*
* # Foo.
* $ wp foo --final abstract
class*/abstract class
CommandFactoryTests_Get_Doc_Comment_2_Command_Win
extends WP_CLI_Command
{
function command1() {}
}
19 changes: 19 additions & 0 deletions tests/data/commandfactory-doc_comment-function-win.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/**
* foo
*/
function commandfactorytests_get_doc_comment_func_1_win( $function = blah ) {
}

/**
* bar
function*/function commandfactorytests_get_doc_comment_func_2_win( $function = blah ) {
}

/**
* /** baz
*/$commandfactorytests_get_doc_comment_func_3_win
=
function ( $args ) {
};
Loading