17 Commits

Author SHA1 Message Date
Nikita Popov
dd63ddbc24 Add php-cs-fixer config and reformat
The formatting in this project has become something of a mess,
because it changed over time. Add a CS fixer config and reformat
to the desired style, which is PSR-12, but with sane brace placement.
2022-08-28 22:57:06 +02:00
Nikita Popov
1f504d2c7d Don't trim in Comment::getReformattedText()
In the past, single-line comments were stored together with the
trailing newline. Later we switched to the PHP8 comment
representation, where the trailing newline is not part of the
comment anymore. As such, there is also no need to trim here.

This is split out from GH-867.
2022-08-07 16:19:39 +02:00
MathiasReker
4021a63cef No superfluous elseif
Replaces superfluous elseif with if.
2022-07-04 20:36:22 +02:00
Nikita Popov
602af9060d Add end line / file position / token position to comments 2020-02-09 16:53:46 +01:00
Gabriel Caruso
68d07c4662 [CS] New line in the end of file 2018-01-13 16:08:26 +01:00
Nikita Popov
68e9b91e9c Use fully-qualified names for global constant references 2017-11-10 23:33:12 +01:00
Nikita Popov
47c973b3aa Store start token position in comments 2017-11-04 17:45:14 +01:00
TomasVotruba
e2e99f269b Add strict_types to lib code 2017-08-18 23:00:13 +02:00
Nikita Popov
a32e3797d4 Generate PHP 7 type annotations 2017-04-28 21:40:59 +02:00
Nikita Popov
bfea338d36 Update doc comments after previous comment
Make some of the type annotations more accurate, and complete the
generated doc-comments to be complete (with description and
parameter annotations.)
2017-01-26 00:16:54 +01:00
Matthew Brown
e3b87f40aa Add non-void return types 2017-01-25 23:32:50 +01:00
Nikita Popov
7dae6c7a6b Implement JsonSerializable for Nodes and Comments
Exposes the properties and adds an additional nodeType property.
2016-07-25 20:59:09 +02:00
Nikita Popov
7ff12b8fcb Remove deprecated Comment methods 2016-07-09 22:00:39 +02:00
Nikita Popov
52cb5ecec7 Fix comment reformatting for some cases
It did not correctly deal with non-standard comments containing
indented lines.
2016-04-07 11:47:40 +09:00
Nikita Popov
60f01bdd86 Deprecate setters on Comment
No point in making it mutable
2016-04-02 07:55:28 +09:00
Nikita Popov
15a2388d75 Add start file offset to Comments 2016-04-02 07:54:01 +09:00
nikic
f82862ec9c Port library to use namespaces, with BC for old names 2014-02-06 20:29:35 +01:00