block closure '}' detect in a string
Brought to you by:
hkodungallur,
tchule
Originally created by: sanders.yao@gmail.com
steps will reproduce the problem
1. Detect code: a string declare that contain a character "}".
2. Result will report error "The block closure '}' must be on a new line.".
3. I found the private variable _inString in file src/PHPCheckstyle.php line 1027 always has a value (bool)false.
4. And I found this variable not assigned in anywhere.
version
I use version 0.12.2 and 0.12.3 reproduce the same problem
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: tch...@hotmail.com
(No comment was entered for this change.)
Status: Accepted
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: tch...@hotmail.com
The "_inString" flag was used when the tokenizer was separating Tokens and String, now everything should be Tokens, so I have removed the flag.
I haven't been able to reproduce the problem with the following test sample :
---------------------------------------
<?php
/**
* Block closure } inside a string.
*/
$a = "test } test";
$a = 'test } test';
----------------------------------
Could you provided a test case and some information about your config (PHP version and system) ? Sometimes the tokenizer doesn't react as I expect.
Could you also run the test with the "--debug" flag on the command line ?
I have the following result :
[exec] Level 0 - line : 6, pos : 13, id : T_CONSTANT_ENCAPSED_STRING, text : "test } test"
[exec] Level 0 - line : 8, pos : 21, id : T_CONSTANT_ENCAPSED_STRING, text : 'test } test'
Thanks a lot,
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: sanders.yao@gmail.com
I expressed incomplete.
Please test this source code :
----------------------------------
<?php
$a = "test {$hello} test";
----------------------------------
I reproduced this problem.
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: tch...@hotmail.com
OK, thanks, problem reproduced and solved (I hope).
I have commited a patch on trunk, I will have to test for regression before to release a new version.
Status: Fixed