Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for "Function ReflectionType::__toString() is deprecated" #417

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "atom-autocomplete-php",
"main": "./lib/peekmo-php-atom-autocomplete",
"version": "0.25.6",
"version": "0.32.0",
"description": "Atom autocompletion plugin for PHP language",
"repository": {
"type": "git",
Expand Down
16 changes: 11 additions & 5 deletions php/services/Tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,17 @@ protected function getMethodArguments(ReflectionFunctionAbstract $function)
'descriptions' => $docParseResult['descriptions'],
'deprecated' => $function->isDeprecated() || $docParseResult['deprecated']
);

$result['return']['type'] = method_exists($function, 'getReturnType') && $function->hasReturnType() // PHP7
? $function->getReturnType()->__toString()
: $result['return']['type']
;

$phpVersion = (float)phpversion();

if ($phpVersion >= 7.1) {
$result['return']['type'] = $function->getReturnType()->getName();
} else {
$result['return']['type'] = method_exists($function, 'getReturnType') && $function->hasReturnType() // PHP7
? $function->getReturnType()->__toString()
: $result['return']['type']
;
}

return $result;
}
Expand Down
198 changes: 198 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


atom-space-pen-views@~2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/atom-space-pen-views/-/atom-space-pen-views-2.0.5.tgz#4ef545a6ef396c8342717b0d9d2569577a2651f4"
integrity sha1-TvVFpu85bINCcXsNnSVpV3omUfQ=
dependencies:
fuzzaldrin "^2.1.0"
space-pen "^5.0.1"

"charenc@~ 0.0.1":
version "0.0.2"
resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667"
integrity sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=

"crypt@~ 0.0.1":
version "0.0.2"
resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b"
integrity sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=

d@1, d@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a"
integrity sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==
dependencies:
es5-ext "^0.10.50"
type "^1.0.1"

d@~0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/d/-/d-0.1.1.tgz#da184c535d18d8ee7ba2aa229b914009fae11309"
integrity sha1-2hhMU10Y2O57oqoim5FACfrhEwk=
dependencies:
es5-ext "~0.10.2"

emissary@^1.2.0:
version "1.3.3"
resolved "https://registry.yarnpkg.com/emissary/-/emissary-1.3.3.tgz#a618d92d682b232d31111dc3625a5df661799606"
integrity sha1-phjZLWgrIy0xER3DYlpd9mF5lgY=
dependencies:
es6-weak-map "^0.1.2"
mixto "1.x"
property-accessors "^1.1"
underscore-plus "1.x"

es5-ext@^0.10.35, es5-ext@^0.10.50, es5-ext@~0.10.2, es5-ext@~0.10.5, es5-ext@~0.10.6:
version "0.10.53"
resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.53.tgz#93c5a3acfdbef275220ad72644ad02ee18368de1"
integrity sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==
dependencies:
es6-iterator "~2.0.3"
es6-symbol "~3.1.3"
next-tick "~1.0.0"

es6-iterator@~0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-0.1.3.tgz#d6f58b8c4fc413c249b4baa19768f8e4d7c8944e"
integrity sha1-1vWLjE/EE8JJtLqhl2j45NfIlE4=
dependencies:
d "~0.1.1"
es5-ext "~0.10.5"
es6-symbol "~2.0.1"

es6-iterator@~2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7"
integrity sha1-p96IkUGgWpSwhUQDstCg+/qY87c=
dependencies:
d "1"
es5-ext "^0.10.35"
es6-symbol "^3.1.1"

es6-symbol@^3.1.1, es6-symbol@~3.1.3:
version "3.1.3"
resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18"
integrity sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==
dependencies:
d "^1.0.1"
ext "^1.1.2"

es6-symbol@~2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-2.0.1.tgz#761b5c67cfd4f1d18afb234f691d678682cb3bf3"
integrity sha1-dhtcZ8/U8dGK+yNPaR1nhoLLO/M=
dependencies:
d "~0.1.1"
es5-ext "~0.10.5"

es6-weak-map@^0.1.2:
version "0.1.4"
resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-0.1.4.tgz#706cef9e99aa236ba7766c239c8b9e286ea7d228"
integrity sha1-cGzvnpmqI2undmwjnIueKG6n0ig=
dependencies:
d "~0.1.1"
es5-ext "~0.10.6"
es6-iterator "~0.1.3"
es6-symbol "~2.0.1"

ext@^1.1.2:
version "1.4.0"
resolved "https://registry.yarnpkg.com/ext/-/ext-1.4.0.tgz#89ae7a07158f79d35517882904324077e4379244"
integrity sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==
dependencies:
type "^2.0.0"

fuzzaldrin@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/fuzzaldrin/-/fuzzaldrin-2.1.0.tgz#90204c3e2fdaa6941bb28d16645d418063a90e9b"
integrity sha1-kCBMPi/appQbso0WZF1BgGOpDps=

grim@^1.0.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/grim/-/grim-1.5.0.tgz#b32b08ef567cf1852f81759ed9c68b0d71396a32"
integrity sha1-sysI71Z88YUvgXWe2caLDXE5ajI=
dependencies:
emissary "^1.2.0"

"is-buffer@~ 1.0.2":
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.0.2.tgz#f5c6c051d73f86f11b4ee14267cc1029fce261d0"
integrity sha1-9cbAUdc/hvEbTuFCZ8wQKfziYdA=

[email protected], jquery@~2.1.4:
version "2.1.4"
resolved "https://registry.yarnpkg.com/jquery/-/jquery-2.1.4.tgz#228bde698a0c61431dc2630a6a154f15890d2317"
integrity sha1-IoveaYoMYUMdwmMKahVPFYkNIxc=

jquery@^2:
version "2.2.4"
resolved "https://registry.yarnpkg.com/jquery/-/jquery-2.2.4.tgz#2c89d6889b5eac522a7eea32c14521559c6cbf02"
integrity sha1-LInWiJterFIqfuoywUUhVZxsvwI=

[email protected]:
version "2.0.0"
resolved "https://registry.yarnpkg.com/md5/-/md5-2.0.0.tgz#75e392e0ebd5a9b88dc7cb7a93875137b87c8a33"
integrity sha1-deOS4OvVqbiNx8t6k4dRN7h8ijM=
dependencies:
charenc "~ 0.0.1"
crypt "~ 0.0.1"
is-buffer "~ 1.0.2"

[email protected]:
version "1.0.0"
resolved "https://registry.yarnpkg.com/mixto/-/mixto-1.0.0.tgz#c320ef61b52f2898f522e17d8bbc6d506d8425b6"
integrity sha1-wyDvYbUvKJj1IuF9i7xtUG2EJbY=

next-tick@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c"
integrity sha1-yobR/ogoFpsBICCOPchCS524NCw=

property-accessors@^1.1:
version "1.1.3"
resolved "https://registry.yarnpkg.com/property-accessors/-/property-accessors-1.1.3.tgz#1dde84024631865909ef30703365680c5f928b15"
integrity sha1-Hd6EAkYxhlkJ7zBwM2VoDF+SixU=
dependencies:
es6-weak-map "^0.1.2"
mixto "1.x"

space-pen@^5.0.1:
version "5.1.2"
resolved "https://registry.yarnpkg.com/space-pen/-/space-pen-5.1.2.tgz#22fbbe10e0b044e7b7a47b023da99d94b584ef8f"
integrity sha1-Ivu+EOCwROe3pHsCPamdlLWE748=
dependencies:
grim "^1.0.0"
jquery "2.1.4"
underscore-plus "1.x"

sub-atom@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/sub-atom/-/sub-atom-1.0.0.tgz#09c78b2c562a0768083605a29b0372ada3ee8c14"
integrity sha1-CceLLFYqB2gINgWimwNyraPujBQ=
dependencies:
jquery "^2"

type@^1.0.1:
version "1.2.0"
resolved "https://registry.yarnpkg.com/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0"
integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==

type@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/type/-/type-2.0.0.tgz#5f16ff6ef2eb44f260494dae271033b29c09a9c3"
integrity sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow==

[email protected]:
version "1.7.0"
resolved "https://registry.yarnpkg.com/underscore-plus/-/underscore-plus-1.7.0.tgz#107f1900c520ac1fefe4edec6580a7ff08a99d0f"
integrity sha512-A3BEzkeicFLnr+U/Q3EyWwJAQPbA19mtZZ4h+lLq3ttm9kn8WC4R3YpuJZEXmWdLjYP47Zc8aLZm9kwdv+zzvA==
dependencies:
underscore "^1.9.1"

underscore@^1.9.1:
version "1.10.2"
resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.10.2.tgz#73d6aa3668f3188e4adb0f1943bd12cfd7efaaaf"
integrity sha512-N4P+Q/BuyuEKFJ43B9gYuOj4TQUHXX+j2FqguVOpjkssLUUrnJofCcBccJSCoeturDoZU6GorDTHSvUDlSQbTg==