├── src ├── Project.php ├── Element.php ├── ProjectFactory.php ├── File.php ├── Location.php └── Fqsen.php ├── composer.json ├── README.md ├── LICENSE └── .yamllint.yaml /src/Project.php: -------------------------------------------------------------------------------- 1 | lineNumber = $lineNumber; 35 | $this->columnNumber = $columnNumber; 36 | } 37 | 38 | /** 39 | * Returns the line number that is covered by this location. 40 | */ 41 | public function getLineNumber(): int 42 | { 43 | return $this->lineNumber; 44 | } 45 | 46 | /** 47 | * Returns the column number (character position on a line) for this location object. 48 | */ 49 | public function getColumnNumber(): int 50 | { 51 | return $this->columnNumber; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /.yamllint.yaml: -------------------------------------------------------------------------------- 1 | extends: "default" 2 | 3 | ignore: | 4 | .build/ 5 | .notes/ 6 | vendor/ 7 | rules: 8 | braces: 9 | max-spaces-inside-empty: 0 10 | max-spaces-inside: 1 11 | min-spaces-inside-empty: 0 12 | min-spaces-inside: 1 13 | brackets: 14 | max-spaces-inside-empty: 0 15 | max-spaces-inside: 0 16 | min-spaces-inside-empty: 0 17 | min-spaces-inside: 0 18 | colons: 19 | max-spaces-after: 1 20 | max-spaces-before: 0 21 | commas: 22 | max-spaces-after: 1 23 | max-spaces-before: 0 24 | min-spaces-after: 1 25 | comments: 26 | ignore-shebangs: true 27 | min-spaces-from-content: 1 28 | require-starting-space: true 29 | comments-indentation: "enable" 30 | document-end: 31 | present: false 32 | document-start: 33 | present: false 34 | indentation: 35 | check-multi-line-strings: false 36 | indent-sequences: true 37 | spaces: 2 38 | empty-lines: 39 | max-end: 0 40 | max-start: 0 41 | max: 1 42 | empty-values: 43 | forbid-in-block-mappings: true 44 | forbid-in-flow-mappings: true 45 | hyphens: 46 | max-spaces-after: 2 47 | key-duplicates: "enable" 48 | key-ordering: "disable" 49 | line-length: "disable" 50 | new-line-at-end-of-file: "enable" 51 | new-lines: 52 | type: "unix" 53 | octal-values: 54 | forbid-implicit-octal: true 55 | quoted-strings: 56 | quote-type: "double" 57 | trailing-spaces: "enable" 58 | truthy: 59 | allowed-values: 60 | - "false" 61 | - "true" 62 | 63 | yaml-files: 64 | - "*.yaml" 65 | - "*.yml" 66 | -------------------------------------------------------------------------------- /src/Fqsen.php: -------------------------------------------------------------------------------- 1 | fqsen = $fqsen; 62 | 63 | if (isset($matches[2])) { 64 | $this->name = $matches[2]; 65 | } elseif ($fqsen === '\\') { 66 | $this->name = ''; 67 | } else { 68 | $matches = explode('\\', $fqsen); 69 | $name = end($matches); 70 | $this->name = trim($name, '()'); 71 | } 72 | } 73 | 74 | /** 75 | * converts this class to string. 76 | */ 77 | public function __toString(): string 78 | { 79 | return $this->fqsen; 80 | } 81 | 82 | /** 83 | * Returns the name of the element without path. 84 | */ 85 | public function getName(): string 86 | { 87 | return $this->name; 88 | } 89 | } 90 | --------------------------------------------------------------------------------