2012-11-25 13:10:58 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Foo;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* class Fail { }
|
|
|
|
*/
|
|
|
|
class StripNoise
|
|
|
|
{
|
2019-04-03 09:38:06 +00:00
|
|
|
public function test_heredoc()
|
2012-11-25 13:10:58 +00:00
|
|
|
{
|
2019-04-03 09:38:06 +00:00
|
|
|
return <<<HEREDOC
|
|
|
|
class FailHeredocBasic
|
2012-11-25 13:10:58 +00:00
|
|
|
{
|
|
|
|
}
|
2019-04-03 09:38:06 +00:00
|
|
|
HEREDOC . <<< WHITESPACE
|
|
|
|
class FailHeredocWhitespace
|
2012-11-25 13:10:58 +00:00
|
|
|
{
|
|
|
|
}
|
2019-04-03 09:38:06 +00:00
|
|
|
WHITESPACE . <<<"DOUBLEQUOTES"
|
|
|
|
class FailHeredocDoubleQuotes
|
2014-04-28 13:19:38 +00:00
|
|
|
{
|
|
|
|
}
|
2019-04-03 09:38:06 +00:00
|
|
|
DOUBLEQUOTES . <<< "DOUBLEQUOTESTABBED"
|
|
|
|
class FailHeredocDoubleQuotesTabbed
|
2014-04-28 13:19:38 +00:00
|
|
|
{
|
2019-04-03 09:38:06 +00:00
|
|
|
}
|
|
|
|
DOUBLEQUOTESTABBED . <<<HEREDOCPHP73
|
|
|
|
class FailHeredocPHP73
|
|
|
|
{
|
|
|
|
}
|
|
|
|
HEREDOCPHP73;
|
|
|
|
}
|
2014-04-28 13:19:38 +00:00
|
|
|
|
2019-04-03 09:38:06 +00:00
|
|
|
public function test_nowdoc()
|
|
|
|
{
|
|
|
|
return <<<'NOWDOC'
|
|
|
|
class FailNowdocBasic
|
|
|
|
{
|
2014-04-28 13:19:38 +00:00
|
|
|
}
|
2019-04-03 09:38:06 +00:00
|
|
|
NOWDOC . <<< 'WHITESPACE'
|
|
|
|
class FailNowdocWhitespace
|
|
|
|
{
|
|
|
|
}
|
|
|
|
WHITESPACE . <<< 'NOWDOCTABBED'
|
|
|
|
class FailNowdocTabbed
|
2014-04-28 13:19:38 +00:00
|
|
|
{
|
|
|
|
}
|
2019-04-03 09:38:06 +00:00
|
|
|
NOWDOCTABBED . <<<'NOWDOCPHP73'
|
|
|
|
class FailNowdocPHP73
|
2019-04-03 08:33:58 +00:00
|
|
|
{
|
|
|
|
}
|
2019-04-03 09:38:06 +00:00
|
|
|
NOWDOCPHP73;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function test_followed_by_parentheses()
|
|
|
|
{
|
|
|
|
return array(<<<PARENTHESES
|
|
|
|
class FailParentheses
|
|
|
|
{
|
|
|
|
}
|
|
|
|
PARENTHESES);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function test_followed_by_comma()
|
|
|
|
{
|
|
|
|
return array(1, 2, <<<COMMA
|
|
|
|
class FailComma
|
|
|
|
{
|
|
|
|
}
|
|
|
|
COMMA, 3, 4);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function test_followed_by_period()
|
|
|
|
{
|
|
|
|
return <<<PERIOD
|
|
|
|
class FailPeriod
|
|
|
|
{
|
|
|
|
}
|
|
|
|
PERIOD.'?>';
|
2012-11-25 13:10:58 +00:00
|
|
|
}
|
|
|
|
|
2019-04-03 09:38:06 +00:00
|
|
|
public function test_simple_string()
|
2012-11-25 13:10:58 +00:00
|
|
|
{
|
2019-04-03 09:38:06 +00:00
|
|
|
return 'class FailSimpleString {}';
|
2012-11-25 13:10:58 +00:00
|
|
|
}
|
|
|
|
}
|