Ecosyste.ms: OpenCollective

An open API service for software projects hosted on Open Collective.

github.com/PHPCSStandards/PHPCSUtils

A suite of utility functions for use with PHP_CodeSniffer
https://github.com/PHPCSStandards/PHPCSUtils

Variables::getMemberProperties(): implement use of Scopes class and remove parse error warning

The parse error warning is the purpose of this method, so doesn't belong here.

As an "interface...

5f4b1d652777b41bc8908d3408807befce965c84 authored almost 5 years ago by jrfnl <[email protected]>
Merge pull request #38 from PHPCSStandards/feature/new-variables-class

New Utils\Variables class

ab45a9b2bb92a461d999097cd86c8587a694676d authored almost 5 years ago by Juliette <[email protected]>
:sparkles: New Utils\Variables class

New `PHPCSUtils\Utils\Variables` class which will hold an improved version of the `File::getMemb...

ee1100660cfa88b32ba553dce58805c95001d3b1 authored almost 5 years ago by jrfnl <[email protected]>
Merge pull request #37 from PHPCSStandards/feature/functiondeclarations-add-reserved-name-utilities

Util\FunctionDeclarations: add new reserved name related utility methods

c8c37be01b414cfa7924ee994eb6dd63d5b7abc7 authored almost 5 years ago by Juliette <[email protected]>
Merge pull request #36 from PHPCSStandards/feature/bcfile-getmethodparameters-test-minor-docs-fix

BCFile:GetMethodParametersTest: minor documentation fix

aa0ebd0d58119aa394bb1248fe40c5a27eb19463 authored almost 5 years ago by Juliette <[email protected]>
Util\FunctionDeclarations: add new reserved name related utility methods

Add three new properties related to PHP reserved function names:
* `$magicFunctions`
* `$magicMe...

621f195039dba187e9252c52435c04f71e688b35 authored almost 5 years ago by jrfnl <[email protected]>
Merge pull request #35 from PHPCSStandards/feature/token-collections-add-paramtypetokens

Tokens\Collections: New `$parameterTypeTokens` token array

e4686d20e1d18b0a9a2b3caa04c1382d5a520192 authored almost 5 years ago by Juliette <[email protected]>
Merge pull request #34 from PHPCSStandards/feature/functiondeclarations-getparameters-various-improvements

FunctionDeclarations::getParameters(): various improvements

1f6d1aeffe8a4b9e677394a1506766ad513b2e85 authored almost 5 years ago by Juliette <[email protected]>
BCFile:GetMethodParametersTest: minor documentation fix

6ffc65d88ce2986f872667e5651f864ab445bfe2 authored almost 5 years ago by jrfnl <[email protected]>
Tokens\Collections: New `$parameterTypeTokens` token array

d387025a797040a6a37e78f6c346ec8431977267 authored almost 5 years ago by jrfnl <[email protected]>
FunctionDeclarations::getParameters(): code simplification and efficiency fix

Once the equal sign has been found, we know that everything else until the end of the parameter ...

d3823774afe15e3cbe1d2fbd6b3c45bc90a50606 authored almost 5 years ago by jrfnl <[email protected]>
FunctionDeclarations::getParameters(): efficiency fix / use type determination

Prevent the method from walking far, far ahead if it would have been passed an import `use` or a...

8bda08b5563e853536e31cf1b4e8c5d8d15d48b7 authored almost 5 years ago by jrfnl <[email protected]>
FunctionDeclarations::getParameters(): switch over to using GetTokensAsString class

No change in behaviour (yet).

c84294b34e53f055274ba289b4292389e2a344d5 authored almost 5 years ago by jrfnl <[email protected]>
FunctionDeclarations::getParameters(): improve defensive coding

Includes unit test.

bf7a9d32a75199d32255b1720cfcb5a65ba9f566 authored almost 5 years ago by jrfnl <[email protected]>
FunctionDeclarations::getParameters(): improve documentation

e233aff81671aba33f23868998d3cc1a9d2583cc authored almost 5 years ago by jrfnl <[email protected]>
Merge pull request #33 from PHPCSStandards/feature/functiondeclarations-getproperties-various-improvements

FunctionDeclarations::getProperties(): various improvements

60e120edb015ea3aee91a6bf2bc9107604143f2b authored almost 5 years ago by Juliette <[email protected]>
FunctionDeclarations::getProperties(): add 'return_type_end_token' to the array

The `getParameters()` method already returns stack pointers to both the "start" and "end" of a p...

766bfe1c3b3b8a39aff8b609636eea268253de5e authored almost 5 years ago by jrfnl <[email protected]>
FunctionDeclarations::getProperties(): has_body determination - efficiency fix + bug fix

No need to walk the same set of tokens twice to determine whether a function has a body.
We alre...

198371590e10d7064ae2e19715285a1ed6201896 authored almost 5 years ago by jrfnl <[email protected]>
FunctionDeclarations::getProperties(): minor code reorganization

* Move the return type tokens array to a class property in the `PHPCSUtils\Tokens\Collections` c...

e47ed7d3a098bdfb09f7b785563bba98b8427cf4 authored almost 5 years ago by jrfnl <[email protected]>
FunctionDeclarations::getProperties(): improve defensive coding

Includes unit test.

37e7788265b7edf64d68526162ae3693f52e230a authored almost 5 years ago by jrfnl <[email protected]>
FunctionDeclarations::getProperties(): fix handling of PHPCS annotations

While probably unlikely to come across in the wild, the utility should handle this type of code ...

648bd4143d5fff7bf834d4f59387e2aeaae95f10 authored almost 5 years ago by jrfnl <[email protected]>
Merge pull request #32 from PHPCSStandards/feature/new-functiondeclarations-class

New Utils\FunctionDeclarations class

39b8a3d93ef59c5dfcd39d459c18efb81daa5aa8 authored almost 5 years ago by Juliette <[email protected]>
:sparkles: New Utils\FunctionDeclarations class

New `PHPCSUtils\Utils\FunctionDeclarations` class which will hold improved versions of the `File...

dcf10fbd1762e8d80343810adf9b277974858541 authored almost 5 years ago by jrfnl <[email protected]>
Merge pull request #31 from PHPCSStandards/feature/new-objectdecl-findextendedinterfacenames-method

Util\ObjectDeclarations: add findExtendedInterfaceNames() method

bcd926217bc69f38b20fb08bd2c1d17e2e261bcc authored almost 5 years ago by Juliette <[email protected]>
Util\ObjectDeclarations: add findExtendedInterfaceNames() method

Interfaces can extend more than one interface (in contrast to classes) and both the PHPCS native...

ed7eb7f2a1dff8ea94128a4dc67a731480b45745 authored almost 5 years ago by jrfnl <[email protected]>
Merge pull request #30 from PHPCSStandards/feature/objectdeclarations-improve-findextends-implements

ObjectDeclarations::findExtendedClassName/findImplementedInterfaceNames(): various improvements

2c32de9d7052d50ba2b3588276042474ec688502 authored almost 5 years ago by Juliette <[email protected]>
Merge pull request #29 from PHPCSStandards/feature/objectdeclarations-improve-getclassproperties

ObjectDeclarations::getClassProperties(): various improvements

b595be0230f9db5441df1852d47da89e27e644f9 authored almost 5 years ago by Juliette <[email protected]>
ObjectDeclarations::findNames(): return cleaned up names

Previously, the method would use the `GetTokensAsString::normal()` method to retrieve the name o...

02ed27073cc924acfe150ac00fad7939cd82b765 authored almost 5 years ago by jrfnl <[email protected]>
ObjectDeclarations::findExtendedClassName/findImplementedInterfaceNames(): refactor

As the logic needed for these two methods, as well as for the (upcoming) `findImplementedInterfa...

cdfc07171d6bfe365020b03734cc1d55d34881b1 authored almost 5 years ago by jrfnl <[email protected]>
ObjectDeclarations::findImplementedInterfaceNames(): fix handling of PHPCS annotations

... as well as handling of comments within the class declaration.

While probably unlikely to co...

5173e87d1ef6e699b18e32444f75f8c1193cfdcd authored almost 5 years ago by jrfnl <[email protected]>
ObjectDeclarations::findExtendedClassName(): fix handling of PHPCS annotations

... as well as handling of comments within the class declaration.

While probably unlikely to co...

210c89d359a5e41de928234a4b33f66a96f3877c authored almost 5 years ago by jrfnl <[email protected]>
ObjectDeclarations::getClassProperties(): minor code reorganization

* Move the class modifier keywords array to a class property in the `PHPCSUtils\Tokens\Collectio...

e2c7927e7ee7018d7166977ccba2705d5bae08ae authored almost 5 years ago by jrfnl <[email protected]>
ObjectDeclarations::getClassProperties(): don't allow for both abstract + final (parse error)

A class cannot both be `abstract` as well as `final`, so the utility method should not have to a...

5f2a81107d3a94de3c044f8d0067674420b7b1ec authored almost 5 years ago by jrfnl <[email protected]>
ObjectDeclarations::getClassProperties(): improve defensive coding

Includes unit test.

d55367f345389cf4aff620eb7ad0560d532a04df authored almost 5 years ago by jrfnl <[email protected]>
ObjectDeclarations::getClassProperties(): fix handling of PHPCS annotations

... as well as handling of unorthodox placement of DocBlocks.

While probably unlikely to come a...

751c0541a445870f8296326ca813633f3395e398 authored almost 5 years ago by jrfnl <[email protected]>
Merge pull request #28 from PHPCSStandards/feature/objectdeclarations-improve-getname

Objectdeclarations::getName(): various improvements

d4c4dbfcddc20dee66be5dbaaf1a5939b7f72d06 authored almost 5 years ago by Juliette <[email protected]>
ObjectDeclarations::getName(): improve defensive coding

Includes unit test.

b169c3778c5976b9fd7f9f8391ffead9216c0b7f authored almost 5 years ago by jrfnl <[email protected]>
ObjectDeclarations::getName(): improved handling of parse errors

While certain names may be invalid, such as construct names starting with a number, for the purp...

a5fddd60da7a33a848161f4eddfe31879e3efd8a authored almost 5 years ago by jrfnl <[email protected]>
Merge pull request #27 from PHPCSStandards/feature/new-objectdeclarations-class

New Utils\ObjectDeclarations class

bf351ded7952cdea9c8ee89221d36e8fe7b50560 authored almost 5 years ago by Juliette <[email protected]>
:sparkles: New Utils\ObjectDeclarations class

New `PHPCSUtils\Utils\ObjectDeclarations` class which will hold improved versions of the `File::...

ff505923dc8056f36d931426a4d8d02563f120ff authored almost 5 years ago by jrfnl <[email protected]>
Merge pull request #26 from PHPCSStandards/feature/bcfile-getclassproperties-add-tests

BCFile::getClassProperties(): add unit tests

58543a291955aa7e396f93902946677439925a3c authored almost 5 years ago by Juliette <[email protected]>
Merge pull request #25 from PHPCSStandards/feature/bcfile-getdeclarationame-add-tests-and-fix-bc

BCFile::getDeclarationName(): add unit tests and fix compatibility with older PHPCS versions

f274b7b7b9c6be2642041372f7c2cc0fbef1e8dd authored almost 5 years ago by Juliette <[email protected]>
BCFile::getClassProperties(): add unit tests

e9748a946b13225bb124769617907d6b3f9b40d1 authored almost 5 years ago by jrfnl <[email protected]>
BCFile::getDeclarationName(): fix compatibility with PHPCS < 2.6.1 [3]

In PHPCS 2.6.0, when live coding, the last token in a file can be tokenized as `T_STRING`, but w...

579dc061bc62e2dc63124be922d065edebaa018e authored almost 5 years ago by jrfnl <[email protected]>
BCFile::getDeclarationName(): exclude JS ES6 method support for PHPCS < 3.0.0 [2]

In PHPCS 2.x, for JS files, ES6 method were not tokenized as `T_FUNCTION`.

As the `class` condi...

bec84c41db4dd40aac6db6dafef838b8a9365a31 authored almost 5 years ago by jrfnl <[email protected]>
BCFile::getDeclarationName(): fix JS ES6 class compatibility with PHPCS < 3.0.0 [1]

In PHPCS 2.x, for JS files, ES6 classes were not tokenized as `T_CLASS`.

This commit adds work-...

15b4fe1b816a4a32effd5a0f8910883035626815 authored almost 5 years ago by jrfnl <[email protected]>
BCFile::getDeclarationName(): add unit tests

a4a2b46f3237aa5f977e9c99495750b3ed3fe593 authored almost 5 years ago by jrfnl <[email protected]>
Merge pull request #24 from PHPCSStandards/feature/utils/new-scopes-class

New Utils\Scopes class

bf94e1a94a26353392ac8850f5f0b5e1b2622727 authored almost 5 years ago by Juliette <[email protected]>
:sparkles: New Utils\Scopes class

New `PHPCSUtils\Utils\Scopes` class which will hold methods related to the scoping of tokens.
Th...

e99f0bcf9e6e6403000e20152d0c0314545931c7 authored almost 5 years ago by jrfnl <[email protected]>
Merge pull request #23 from PHPCSStandards/feature/utilitymethodtestcase-allow-overruling-of-tabwidth

TestUtils\UtilityMethodTestCase: allow for overruling the default tab width

2b9e36ab575aea8f26267bf0d4c4ce4dcc5ef429 authored almost 5 years ago by Juliette <[email protected]>
TestUtils\UtilityMethodTestCase: allow for overruling the default tab width

This allows for concrete child classes to set a custom tab width to use for a particular test.

2583a68db93132f3868346e21fcb299569d9104e authored almost 5 years ago by jrfnl <[email protected]>
Merge pull request #22 from PHPCSStandards/feature/bcfile-getmemberprops-sync-test-with-upstream

BCFile::getMemberProperties(): sync tests with PHPCS

94485b4fed3341be9f0cc45a54310d1253519d66 authored almost 5 years ago by Juliette <[email protected]>
Merge pull request #21 from PHPCSStandards/feature/bcfile-minor-docs-update

BCFile: minor documentation update

a44fe790b24d719fbcf19001990e52d925a6be24 authored almost 5 years ago by Juliette <[email protected]>
Merge pull request #20 from PHPCSStandards/feature/minor-cs-cleanup

Minor CS clean up

be164ca0b11f2f2729eaa98d9aa50eca894bd10a authored almost 5 years ago by Juliette <[email protected]>
Merge pull request #19 from PHPCSStandards/feature/new-tokens-collections-class

New Tokens\Collections class

a15eb28ac971761a901bfbe3875a9814058db118 authored almost 5 years ago by Juliette <[email protected]>
BCFile::getMemberProperties(): sync tests with PHPCS

Update for changed made in upstream PR 2804.

cf4e6dc594c6c74e093054ee1765cbaa6e2da5e4 authored almost 5 years ago by jrfnl <[email protected]>
BCFile: minor documentation update

See squizlabs/PHP_CodeSniffer 2809

Co-authored-by: Klaus Purer <[email protected]>

6159a05a50296d3c2aa1401415f477beee588240 authored almost 5 years ago by jrfnl <[email protected]>
Minor CS clean up

059988bcc37763d0d0d7209f88ec35a03e14482b authored almost 5 years ago by jrfnl <[email protected]>
:sparkles: New Tokens\Collections class

New `PHPCSUtils\Tokens\Collections` class which will hold "collections" of related tokens in sta...

e5fe3aa16665d148e49e42e20b9996379aca535b authored almost 5 years ago by jrfnl <[email protected]>
Merge pull request #18 from PHPCSStandards/feature/composer-update-dependency

Composer: update PHPCS Composer plugin dependency

35f20c39ae51846ca4c5f019d5a1c08e5a2dd92e authored almost 5 years ago by Juliette <[email protected]>
Composer: update PHPCS Composer plugin dependency

The DealerDirect Composer plugin has just released version `0.6.0`.
As Composer treats minors < ...

8f45d8816389668df51410d9e14d75314324914a authored almost 5 years ago by jrfnl <[email protected]>
Merge pull request #17 from PHPCSStandards/feature/utils/new-gettokensasstring-class

New Utils\GetTokensAsString class

4766e1979f3feddcfb2f4c9ca99d51d2e5517df7 authored about 5 years ago by Juliette <[email protected]>
:sparkles: New Utils\GetTokensAsString class

This adds five new utility/convenience methods which are closely related to the PHPCS native `Fi...

fcc043523721ee22f0612c1a6fb9d7f91e0265ba authored about 5 years ago by jrfnl <[email protected]>
Merge pull request #14 from PHPCSStandards/feature/bcfile-getokensasstring-add-unit-tests

BCFile::getTokensAsString(): add unit tests

373f00772191aabbecbe2db057c1e38640b694dd authored about 5 years ago by Juliette <[email protected]>
BCFile::getTokensAsString(): add unit tests

9621499e331bff339628324d17d50c20e78e78a6 authored about 5 years ago by jrfnl <[email protected]>
Merge pull request #16 from PHPCSStandards/feature/utils/new-parentheses-class

New Utils\Parentheses class

06f2b4abea6ce18590beb894d2072cd63c2f39de authored about 5 years ago by Juliette <[email protected]>
Utils\Parentheses: fix compatibility with PHPCS < 3.5.0

For this class to be compatible with PHPCS 2.6.0 - `master`, two work-arounds need to be added:
...

978e9b3f194a461609397261fdb99e3063f1013e authored about 5 years ago by jrfnl <[email protected]>
:sparkles: New Utils\Parentheses class

This adds eleven new utility/convenience methods.

The first two are targeted at open/close pare...

27519dad9d4226baa857f75599f04a8dfc28ad8c authored about 5 years ago by jrfnl <[email protected]>
Merge pull request #15 from PHPCSStandards/feature/utils/new-conditions-class

New Utils\Conditions class

6eb546693851a7dd37acecb15638faa5d47e8c15 authored about 5 years ago by Juliette <[email protected]>
Utils\Conditions: add getFirstCondition() and getLastCondition() methods

This adds two additional utility methods:
* `getFirstCondition()` - to retrieve the first condit...

e91801f3378e2dcc7e7f8bca828b7df0a53ce114 authored about 5 years ago by jrfnl <[email protected]>
Conditions::getCondition(): refactor the method to be more versatile

This refactors the `PHPCSUtils\Utils\Conditions::getCondition()` method to be more versatile wit...

90870599ee59f30001a0636193bcc2c893d00274 authored about 5 years ago by jrfnl <[email protected]>
:sparkles: New Utils\Conditions class

New `PHPCSUtils\Utils\Conditions` class which will hold improved versions of the `File::hasCondi...

cd5b135a309550a2b3f170d181bc7cdae95c4bf0 authored about 5 years ago by jrfnl <[email protected]>
Merge pull request #13 from PHPCSStandards/feature/bcfile-getconditions-add-unit-tests

BCFile::get/hasCondition(): add unit tests

633e487e475caa42887382f089c0978be1a884f2 authored about 5 years ago by Juliette <[email protected]>
BCFile::get/hasCondition(): fall-back to PHPCS native function

As the unit tests which have now been added, confirm that there are no cross-version compatibili...

7e60cbc993353e6fad6ee2f304f400f6333001e4 authored about 5 years ago by jrfnl <[email protected]>
BCFile::get/hasCondition(): add unit tests

80f9bd069067796f169a7b0a5855e0fe7266aa26 authored about 5 years ago by jrfnl <[email protected]>
Merge pull request #12 from PHPCSStandards/feature/import-utilities-from-phpcs-itself

New BackCompat\BCFile class - import of utilities from phpcs itself

76c9b2d7bd9e80185268429c7bf62f18473b1e66 authored about 5 years ago by Juliette <[email protected]>
BackCompat\BCFile: document work-arounds added

Add documentation about which Tokenizer changes are being accounted for in the utility methods i...

6930cec09b654e36a815a5d8d07a910d858b955a authored about 5 years ago by jrfnl <[email protected]>
BCFile::findImplementedInterfaceNames(): make the existing unit tests feature complete

* Test support of anonymous classes.
* Test handling of the PHPCS 3.2.0+ ignore annotations.
* T...

3b452d4e2a8536791bb5f4a07a719b561c6de1c7 authored about 5 years ago by jrfnl <[email protected]>
BCFile::findImplementedInterfaceNames(): add changelog for PHPCS changes

... between PHPCS 2.6.0 and now.

4dc4d79710dc38ee039e7d8243fd09f6cdd41173 authored about 5 years ago by jrfnl <[email protected]>
BCFile::findImplementedInterfaceNames(): improve documentation

59f690ccdf7d8d9d2aae901bba47e6bfd59d7136 authored about 5 years ago by jrfnl <[email protected]>
BCFile::findExtendedClassName(): make the existing unit tests feature complete

* Test support of anonymous classes.
* Test the situations in which the method returns `false`.
...

f8e7b152bf92ea38e2395e62bd47c26c132ad88c authored about 5 years ago by jrfnl <[email protected]>
BCFile::findExtendedClassName(): add changelog for PHPCS changes

... between PHPCS 2.6.0 and now.

a407191ed52bc7195dda6748a0eaaab9a13da88a authored about 5 years ago by jrfnl <[email protected]>
BCFile::findExtendedClassName(): improve documentation

1f4397bb236bc25195afe858590def299905a645 authored about 5 years ago by jrfnl <[email protected]>
BCFile::getCondition(): add changelog for PHPCS changes

... between PHPCS 2.6.0 and now.

b67c38b47ba90d4bbdfb50881e59f71236709670 authored about 5 years ago by jrfnl <[email protected]>
BCFile::getCondition(): improve documentation

1f18fbfbeb2e19a25cb52287787f295e72c1c81a authored about 5 years ago by jrfnl <[email protected]>
BCFile::hasCondition(): add changelog for PHPCS changes

... between PHPCS 2.6.0 and now.

27adfe83cf536b1fb7792bd588d14f6d096ef41a authored about 5 years ago by jrfnl <[email protected]>
BCFile::findEndOfStatement(): add changelog for PHPCS changes

... between PHPCS 2.6.0 and now.

40b2cc0b084ab118f745ef81c0ba9aa23bd860c7 authored about 5 years ago by jrfnl <[email protected]>
BCFile::findStartOfStatement(): add changelog for PHPCS changes

... between PHPCS 2.6.0 and now.

f47ebfa63a382b33972b771155efb5af24d4db20 authored about 5 years ago by jrfnl <[email protected]>
BCFile::getTokensAsString(): add changelog for PHPCS changes

... between PHPCS 2.6.0 and now.

73f32e9160229cd1270401466368b7219dda4fcb authored about 5 years ago by jrfnl <[email protected]>
BCFile::getTokensAsString(): improve documentation

edd78b5ef6a697b5790849e2226f5e34a3274d3b authored about 5 years ago by jrfnl <[email protected]>
BCFile::isReference(): fix code coverage not correctly registering

d1b7138855f5ad392aa1df10ec0eee54bc633cab authored about 5 years ago by jrfnl <[email protected]>
BCFile::isReference(): fix compatibility with PHPCS 2.8.1

... as while the `T_COALESCE_EQUAL` was introduced in PHPCS 2.8.1, it wasn't added to the `Token...

8face2629be90a9bc34a82f09d107800f692a96e authored about 5 years ago by jrfnl <[email protected]>
BCFile::isReference(): add tests for list assignments by reference (PHP 7.3+)

3b5253edb1bffbdbe18c59cada194385fbeb6a5a authored about 5 years ago by jrfnl <[email protected]>
BCFile::isReference(): make the existing unit tests feature complete

* Test passing an unexpected token.
* Test assignment using null coalesce equals.

5390cf8129174d8616e0039d09d614f19aeccde3 authored about 5 years ago by jrfnl <[email protected]>
BCFile::isReference(): fix test documentation

04dccfb8096f621f605e143f4ba2dd00ccc935cc authored about 5 years ago by jrfnl <[email protected]>
BCFile::isReference(): fix minor parse errors in the unit test case file

f9274ab2a0a7ed96ff9334a64eaaf598eab28ccf authored about 5 years ago by jrfnl <[email protected]>
BCFile::isReference(): add changelog for PHPCS changes

... between PHPCS 2.6.0 and now.

1d1ba73461619846a32173ca664235b61ba4ce32 authored about 5 years ago by jrfnl <[email protected]>
BCFile::isReference(): improve documentation

a96afda999afa64dd7698874efb004706e253617 authored about 5 years ago by jrfnl <[email protected]>
BCFile::getClassProperties(): add changelog for PHPCS changes

... between PHPCS 2.6.0 and now.

a038371f844452082e973fc74953539c1d7c45cf authored about 5 years ago by jrfnl <[email protected]>
BCFile::getClassProperties(): improve documentation

e544dca1d84b27b0365fd661de76d3964cfa06bf authored about 5 years ago by jrfnl <[email protected]>