"description":"The file snippets/php.json was derived from the Atom package https://atom.io/packages/language-php which was originally converted from the PHP TextMate bundle https://github.com/textmate/php.tmbundle."
"If not otherwise specified (see below), files in this repository fall under the following license:",
"",
"Permission to copy, use, modify, sell and distribute this",
"software is granted. This software is provided \"as is\" without",
"express or implied warranty, and with no claim as to its",
"suitability for any purpose.",
"",
"An exception is made for files in readable text which contain their own license information,",
"or files where an accompanying file exists (in the same directory) with a \"-license\" suffix added",
"to the base-name name of the original file, and an extension of txt, html, or similar. For example",
"\"tidy\" is accompanied by \"tidy-license.txt\"."
]
"description":"The files snippets/php.json & syntaxes/php.tmLanguage.json were derived from the Atom package https://atom.io/packages/language-php which was originally converted from the PHP TextMate bundle https://github.com/textmate/php.tmbundle."
"comment":"This now only highlights a docblock if the first line contains only /**\n\t\t\t\t\t\t\t\t- this is to stop highlighting everything as invalid when people do comment banners with /******** ...\n\t\t\t\t\t\t\t\t- Now matches /**#@+ too - used for docblock templates: http://manual.phpdoc.org/HTMLframesConverter/default/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#basics.docblocktemplate",
"comment":"In PHP, any identifier which is not a variable is taken to be a constant.\n\t\t\t\tHowever, if there is no constant defined with the given name then a notice\n\t\t\t\tis generated and the constant is assumed to have the value of its name.",
"begin":"(?xi)\n\t\t\t\t\t\t\t\\s*(array) # Typehint\n\t\t\t\t\t\t\t\\s*(&)? \t\t\t\t\t# Reference\n\t\t\t\t\t\t\t\\s*((\\$+)[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*) # The variable name\n\t\t\t\t\t\t\t\\s*(=)\t# A default value\n\t\t\t\t\t\t\t\\s*(array)\\s*(\\()\n\t\t\t\t\t\t\t",
"beginCaptures":{
"1":{
"name":"storage.type.php"
},
"2":{
"name":"storage.modifier.reference.php"
},
"3":{
"name":"variable.other.php"
},
"4":{
"name":"punctuation.definition.variable.php"
},
"5":{
"name":"keyword.operator.assignment.php"
},
"6":{
"name":"support.function.construct.php"
},
"7":{
"name":"punctuation.definition.array.begin.php"
}
},
"contentName":"meta.array.php",
"end":"\\)",
"endCaptures":{
"0":{
"name":"punctuation.definition.array.end.php"
}
},
"name":"meta.function.argument.array.php",
"patterns":[
{
"include":"#comments"
},
{
"include":"#strings"
},
{
"include":"#numbers"
}
]
},
{
"captures":{
"1":{
"name":"storage.type.php"
},
"2":{
"name":"storage.modifier.reference.php"
},
"3":{
"name":"variable.other.php"
},
"4":{
"name":"punctuation.definition.variable.php"
},
"5":{
"name":"keyword.operator.assignment.php"
},
"6":{
"name":"constant.language.php"
},
"7":{
"name":"punctuation.section.array.begin.php"
},
"8":{
"patterns":[
{
"include":"#parameter-default-types"
}
]
},
"9":{
"name":"punctuation.section.array.end.php"
},
"10":{
"name":"invalid.illegal.non-null-typehinted.php"
}
},
"match":"(?xi)\n\t\t\t\t\t\t\t\\s*(array|callable) # Typehint\n\t\t\t\t\t\t\t\\s*(&)? \t\t\t\t\t# Reference\n\t\t\t\t\t\t\t\\s*((\\$+)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*) # The variable name\n\t\t\t\t\t\t\t(?:\n\t\t\t\t\t\t\t\t\\s*(?:(=)\\s*(?:(null)|(\\[)((?>[^\\[\\]]+|\\[\\g<8>\\])*)(\\])|((?:\\S*?\\(\\))|(?:\\S*?))))\t# A default value\n\t\t\t\t\t\t\t)?\n\t\t\t\t\t\t\t\\s*(?=,|\\)|/[/*]|\\#|$) # A closing parentheses (end of argument list) or a comma or a comment\n\t\t\t\t\t\t\t",
"match":"(?xi)\n\t\t\t\t\t\t\t\\s*([a-z_][a-z_0-9]*)? # Typehinted class name\n\t\t\t\t\t\t\t\\s*(&)? \t\t\t\t\t# Reference\n\t\t\t\t\t\t\t\\s*(((?:\\.\\.\\.)?\\$+)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*) # The variable name\n\t\t\t\t\t\t\t(?:\n\t\t\t\t\t\t\t\t\\s*(?:(=)\\s*(?:(null)|((?:\\S*?\\(\\))|(?:\\S*?))))\t# A default value\n\t\t\t\t\t\t\t)?\n\t\t\t\t\t\t\t\\s*(?=,|\\)|/[/*]|\\#|$) # A closing parentheses (end of argument list) or a comma\n\t\t\t\t\t "
"comment":"We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.",
"comment":"Unclosed strings must be captured to avoid them eating the remainder of the PHP script\n\t\t\t\t\tSample case: $sql = \"SELECT * FROM bar WHERE foo = '\" . $variable . \"'\"",
"match":"'(?=((\\\\')|[^'\"])*(\"|$))",
"name":"string.quoted.single.unclosed.sql"
},
{
"comment":"Unclosed strings must be captured to avoid them eating the remainder of the PHP script\n\t\t\t\t\tSample case: $sql = \"SELECT * FROM bar WHERE foo = '\" . $variable . \"'\"",
"comment":"Unclosed strings must be captured to avoid them eating the remainder of the PHP script\n\t\t\t\t\tSample case: $sql = \"SELECT * FROM bar WHERE foo = '\" . $variable . \"'\"",
"comment":"Unclosed strings must be captured to avoid them eating the remainder of the PHP script\n\t\t\t\t\tSample case: $sql = \"SELECT * FROM bar WHERE foo = '\" . $variable . \"'\"",
"match":"\"(?=((\\\\\")|[^\"'])*('|$))",
"name":"string.quoted.double.unclosed.sql"
},
{
"include":"source.sql"
}
]
},
"string-backtick":{
"begin":"`",
"beginCaptures":{
"0":{
"name":"punctuation.definition.string.begin.php"
}
},
"end":"`",
"endCaptures":{
"0":{
"name":"punctuation.definition.string.end.php"
}
},
"name":"string.interpolated.php",
"patterns":[
{
"match":"\\\\.",
"name":"constant.character.escape.php"
},
{
"include":"#interpolation"
}
]
},
"string-double-quoted":{
"begin":"\"",
"beginCaptures":{
"0":{
"name":"punctuation.definition.string.begin.php"
}
},
"comment":"This contentName is just to allow the usage of “select scope” to select the string contents first, then the string with quotes",
"comment":"This now only highlights a docblock if the first line contains only /**\n\t\t\t\t\t\t\t\t- this is to stop highlighting everything as invalid when people do comment banners with /******** ...\n\t\t\t\t\t\t\t\t- Now matches /**#@+ too - used for docblock templates: http://manual.phpdoc.org/HTMLframesConverter/default/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#basics.docblocktemplate",
"comment":"In PHP, any identifier which is not a variable is taken to be a constant.\n\t\t\t\tHowever, if there is no constant defined with the given name then a notice\n\t\t\t\tis generated and the constant is assumed to have the value of its name.",
"begin":"(?xi)\n\t\t\t\t\t\t\t\\s*(array) # Typehint\n\t\t\t\t\t\t\t\\s*(&)? \t\t\t\t\t# Reference\n\t\t\t\t\t\t\t\\s*((\\$+)[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*) # The variable name\n\t\t\t\t\t\t\t\\s*(=)\t# A default value\n\t\t\t\t\t\t\t\\s*(array)\\s*(\\()\n\t\t\t\t\t\t\t",
"beginCaptures":{
"1":{
"name":"storage.type.php"
},
"2":{
"name":"storage.modifier.reference.php"
},
"3":{
"name":"variable.other.php"
},
"4":{
"name":"punctuation.definition.variable.php"
},
"5":{
"name":"keyword.operator.assignment.php"
},
"6":{
"name":"support.function.construct.php"
},
"7":{
"name":"punctuation.definition.array.begin.php"
}
},
"contentName":"meta.array.php",
"end":"\\)",
"endCaptures":{
"0":{
"name":"punctuation.definition.array.end.php"
}
},
"name":"meta.function.argument.array.php",
"patterns":[
{
"include":"#comments"
},
{
"include":"#strings"
},
{
"include":"#numbers"
}
]
},
{
"captures":{
"1":{
"name":"storage.type.php"
},
"2":{
"name":"storage.modifier.reference.php"
},
"3":{
"name":"variable.other.php"
},
"4":{
"name":"punctuation.definition.variable.php"
},
"5":{
"name":"keyword.operator.assignment.php"
},
"6":{
"name":"constant.language.php"
},
"7":{
"name":"punctuation.section.array.begin.php"
},
"8":{
"patterns":[
{
"include":"#parameter-default-types"
}
]
},
"9":{
"name":"punctuation.section.array.end.php"
},
"10":{
"name":"invalid.illegal.non-null-typehinted.php"
}
},
"match":"(?xi)\n\t\t\t\t\t\t\t\\s*(array|callable) # Typehint\n\t\t\t\t\t\t\t\\s*(&)? \t\t\t\t\t# Reference\n\t\t\t\t\t\t\t\\s*((\\$+)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*) # The variable name\n\t\t\t\t\t\t\t(?:\n\t\t\t\t\t\t\t\t\\s*(?:(=)\\s*(?:(null)|(\\[)((?>[^\\[\\]]+|\\[\\g<8>\\])*)(\\])|((?:\\S*?\\(\\))|(?:\\S*?))))\t# A default value\n\t\t\t\t\t\t\t)?\n\t\t\t\t\t\t\t\\s*(?=,|\\)|/[/*]|\\#|$) # A closing parentheses (end of argument list) or a comma or a comment\n\t\t\t\t\t\t\t",
"match":"(?xi)\n\t\t\t\t\t\t\t\\s*([a-z_][a-z_0-9]*)? # Typehinted class name\n\t\t\t\t\t\t\t\\s*(&)? \t\t\t\t\t# Reference\n\t\t\t\t\t\t\t\\s*(((?:\\.\\.\\.)?\\$+)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*) # The variable name\n\t\t\t\t\t\t\t(?:\n\t\t\t\t\t\t\t\t\\s*(?:(=)\\s*(?:(null)|((?:\\S*?\\(\\))|(?:\\S*?))))\t# A default value\n\t\t\t\t\t\t\t)?\n\t\t\t\t\t\t\t\\s*(?=,|\\)|/[/*]|\\#|$) # A closing parentheses (end of argument list) or a comma\n\t\t\t\t\t "
"comment":"We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.",
"comment":"Unclosed strings must be captured to avoid them eating the remainder of the PHP script\n\t\t\t\t\tSample case: $sql = \"SELECT * FROM bar WHERE foo = '\" . $variable . \"'\"",
"match":"'(?=((\\\\')|[^'\"])*(\"|$))",
"name":"string.quoted.single.unclosed.sql"
},
{
"comment":"Unclosed strings must be captured to avoid them eating the remainder of the PHP script\n\t\t\t\t\tSample case: $sql = \"SELECT * FROM bar WHERE foo = '\" . $variable . \"'\"",
"comment":"Unclosed strings must be captured to avoid them eating the remainder of the PHP script\n\t\t\t\t\tSample case: $sql = \"SELECT * FROM bar WHERE foo = '\" . $variable . \"'\"",
"comment":"Unclosed strings must be captured to avoid them eating the remainder of the PHP script\n\t\t\t\t\tSample case: $sql = \"SELECT * FROM bar WHERE foo = '\" . $variable . \"'\"",
"match":"\"(?=((\\\\\")|[^\"'])*('|$))",
"name":"string.quoted.double.unclosed.sql"
},
{
"include":"source.sql"
}
]
},
"string-backtick":{
"begin":"`",
"beginCaptures":{
"0":{
"name":"punctuation.definition.string.begin.php"
}
},
"end":"`",
"endCaptures":{
"0":{
"name":"punctuation.definition.string.end.php"
}
},
"name":"string.interpolated.php",
"patterns":[
{
"match":"\\\\.",
"name":"constant.character.escape.php"
},
{
"include":"#interpolation"
}
]
},
"string-double-quoted":{
"begin":"\"",
"beginCaptures":{
"0":{
"name":"punctuation.definition.string.begin.php"
}
},
"comment":"This contentName is just to allow the usage of “select scope” to select the string contents first, then the string with quotes",