@rightcapital/phpdoc-parser 0.3.22--.200.1.0 → 0.3.22--.201.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -491,12 +491,13 @@ class TypeParser {
491
491
  parseArrayShapeKey(tokens) {
492
492
  const startLine = tokens.currentTokenLine();
493
493
  const startIndex = tokens.currentTokenIndex();
494
- let key;
495
494
  if (tokens.isCurrentTokenType(lexer_1.Lexer.TOKEN_INTEGER)) {
496
- key = new const_expr_integer_node_1.ConstExprIntegerNode(tokens.currentTokenValue().replaceAll('_', ''));
495
+ const key = new const_expr_integer_node_1.ConstExprIntegerNode(tokens.currentTokenValue().replaceAll('_', ''));
497
496
  tokens.next();
497
+ return this.enrichWithAttributes(tokens, key, startLine, startIndex);
498
498
  }
499
- else if (tokens.isCurrentTokenType(lexer_1.Lexer.TOKEN_SINGLE_QUOTED_STRING)) {
499
+ let key;
500
+ if (tokens.isCurrentTokenType(lexer_1.Lexer.TOKEN_SINGLE_QUOTED_STRING)) {
500
501
  if (this.quoteAwareConstExprString) {
501
502
  key = new quote_aware_const_expr_string_node_1.QuoteAwareConstExprStringNode(string_unescaper_1.StringUnescaper.unescapeString(tokens.currentTokenValue()), quote_aware_const_expr_string_node_1.QuoteAwareConstExprStringNode.SINGLE_QUOTED);
502
503
  }
@@ -505,14 +506,13 @@ class TypeParser {
505
506
  }
506
507
  tokens.next();
507
508
  }
508
- else if (tokens.isCurrentTokenType(lexer_1.Lexer.TOKEN_DOUBLE_QUOTED_STRING)) {
509
+ if (tokens.isCurrentTokenType(lexer_1.Lexer.TOKEN_DOUBLE_QUOTED_STRING)) {
509
510
  if (this.quoteAwareConstExprString) {
510
511
  key = new quote_aware_const_expr_string_node_1.QuoteAwareConstExprStringNode(string_unescaper_1.StringUnescaper.unescapeString(tokens.currentTokenValue()), quote_aware_const_expr_string_node_1.QuoteAwareConstExprStringNode.DOUBLE_QUOTED);
511
512
  }
512
513
  else {
513
514
  key = new const_expr_string_node_1.ConstExprStringNode(tokens.currentTokenValue().replace(/(^"|"$)/g, ''));
514
515
  }
515
- tokens.next();
516
516
  }
517
517
  else {
518
518
  key = new identifier_type_node_1.IdentifierTypeNode(tokens.currentTokenValue());
@@ -553,11 +553,11 @@ class TypeParser {
553
553
  key = new quote_aware_const_expr_string_node_1.QuoteAwareConstExprStringNode(string_unescaper_1.StringUnescaper.unescapeString(tokens.currentTokenValue()), quote_aware_const_expr_string_node_1.QuoteAwareConstExprStringNode.SINGLE_QUOTED);
554
554
  }
555
555
  else {
556
- key = new const_expr_string_node_1.ConstExprStringNode(tokens.currentTokenValue().replace(/(^'|'$)/g, ''));
556
+ key = new const_expr_string_node_1.ConstExprStringNode(tokens.currentTokenValue().replace(/(^"|"$)/g, ''));
557
557
  }
558
558
  tokens.next();
559
559
  }
560
- else if (tokens.isCurrentTokenType(lexer_1.Lexer.TOKEN_DOUBLE_QUOTED_STRING)) {
560
+ if (tokens.isCurrentTokenType(lexer_1.Lexer.TOKEN_DOUBLE_QUOTED_STRING)) {
561
561
  if (this.quoteAwareConstExprString) {
562
562
  key = new quote_aware_const_expr_string_node_1.QuoteAwareConstExprStringNode(string_unescaper_1.StringUnescaper.unescapeString(tokens.currentTokenValue()), quote_aware_const_expr_string_node_1.QuoteAwareConstExprStringNode.DOUBLE_QUOTED);
563
563
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rightcapital/phpdoc-parser",
3
- "version": "0.3.22-.200.1.0",
3
+ "version": "0.3.22-.201.1.0",
4
4
  "keywords": [
5
5
  "PHP",
6
6
  "PHPDoc",
@@ -28,15 +28,15 @@
28
28
  "dist"
29
29
  ],
30
30
  "devDependencies": {
31
- "@babel/core": "7.23.6",
32
- "@babel/preset-env": "7.23.6",
31
+ "@babel/core": "7.23.7",
32
+ "@babel/preset-env": "7.23.8",
33
33
  "@babel/preset-typescript": "7.23.3",
34
- "@commitlint/cli": "18.4.3",
35
- "@commitlint/config-conventional": "18.4.3",
36
- "@commitlint/cz-commitlint": "18.4.3",
34
+ "@commitlint/cli": "18.4.4",
35
+ "@commitlint/config-conventional": "18.4.4",
36
+ "@commitlint/cz-commitlint": "18.4.4",
37
37
  "@rightcapital/eslint-config-javascript": "16.0.1",
38
38
  "@rightcapital/eslint-config-typescript": "16.0.1",
39
- "@rightcapital/prettier-config": "6.0.8",
39
+ "@rightcapital/prettier-config": "6.0.9",
40
40
  "@types/jest": "29.5.11",
41
41
  "@types/lodash": "4.14.202",
42
42
  "babel-jest": "29.7.0",