Mercurial > hg > isophonics-drupal-site
comparison vendor/psy/psysh/src/Psy/TabCompletion/Matcher/MongoClientMatcher.php @ 12:7a779792577d
Update Drupal core to v8.4.5 (via Composer)
author | Chris Cannam |
---|---|
date | Fri, 23 Feb 2018 15:52:07 +0000 |
parents | 4c8ae668cc8c |
children |
comparison
equal
deleted
inserted
replaced
11:bfffd8d7479a | 12:7a779792577d |
---|---|
31 if (self::tokenIs($firstToken, self::T_STRING)) { | 31 if (self::tokenIs($firstToken, self::T_STRING)) { |
32 // second token is the object operator | 32 // second token is the object operator |
33 array_pop($tokens); | 33 array_pop($tokens); |
34 } | 34 } |
35 $objectToken = array_pop($tokens); | 35 $objectToken = array_pop($tokens); |
36 $objectName = str_replace('$', '', $objectToken[1]); | 36 $objectName = str_replace('$', '', $objectToken[1]); |
37 $object = $this->getVariable($objectName); | 37 $object = $this->getVariable($objectName); |
38 | 38 |
39 if (!$object instanceof \MongoClient) { | 39 if (!$object instanceof \MongoClient) { |
40 return array(); | 40 return array(); |
41 } | 41 } |
42 | 42 |
55 /** | 55 /** |
56 * {@inheritdoc} | 56 * {@inheritdoc} |
57 */ | 57 */ |
58 public function hasMatched(array $tokens) | 58 public function hasMatched(array $tokens) |
59 { | 59 { |
60 $token = array_pop($tokens); | 60 $token = array_pop($tokens); |
61 $prevToken = array_pop($tokens); | 61 $prevToken = array_pop($tokens); |
62 | 62 |
63 switch (true) { | 63 switch (true) { |
64 case self::tokenIs($token, self::T_OBJECT_OPERATOR): | 64 case self::tokenIs($token, self::T_OBJECT_OPERATOR): |
65 case self::tokenIs($prevToken, self::T_OBJECT_OPERATOR): | 65 case self::tokenIs($prevToken, self::T_OBJECT_OPERATOR): |