From 0e16e22c5c5571feb48da55892cff41aa183ae85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= Date: Sun, 1 Jul 2018 19:02:36 +0200 Subject: [PATCH] Fix string literal scoping --- specs/string-literal/misc.php | 60 +++++++++++++++++++ .../NodeVisitor/StringScalarPrefixer.php | 2 +- 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 specs/string-literal/misc.php diff --git a/specs/string-literal/misc.php b/specs/string-literal/misc.php new file mode 100644 index 00000000..3cff0d4a --- /dev/null +++ b/specs/string-literal/misc.php @@ -0,0 +1,60 @@ +, + * Pádraic Brady + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + 'meta' => [ + 'title' => 'String literal assigned to a variable', + // Default values. If not specified will be the one used + 'prefix' => 'Humbug', + 'whitelist' => [], + 'whitelist-global-constants' => true, + ], + + 'PHP heredoc as argument' => <<<'PHP' +value)) - || 1 !== preg_match('/^((\\\\)?[\p{L}_]+)|((\\\\)?(?:[\p{L}_]+\\\\+)+[\p{L}_]+)$/u', $node->value) + || 1 !== preg_match('/^((\\\\)?[\p{L}_]+)$|((\\\\)?(?:[\p{L}_]+\\\\+)+[\p{L}_]+)$/u', $node->value) ) { return false; }