Skip to content

Commit

Permalink
added fixes for vim client
Browse files Browse the repository at this point in the history
  • Loading branch information
mkusher committed May 8, 2015
1 parent 1cc6b9c commit 2c4f0fc
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
Expand Down
2 changes: 1 addition & 1 deletion src/Command/SaveCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Command;

class SaveCommand extends AbstractCommand {
public function run(array $arguments){
public function run(array $arguments = []){
$project = $arguments["project"];
/** @var \IO\Writer $writer */
$writer = $this->get('IO\Writer');
Expand Down
4 changes: 3 additions & 1 deletion src/DI/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
Psr\Log\LoggerInterface::class => DI\factory(function () {
$logger = new Logger('completer');

$logger->pushHandler(new \Monolog\Handler\ErrorLogHandler());
$logger->pushHandler(new \Monolog\Handler\StreamHandler(
"php://stdout"
));
return $logger;
}),
];
12 changes: 10 additions & 2 deletions src/Parser/Processor/ScopeProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

use Parser\UseParser;
use Parser\CommentParser;
use Complete\Resolver\NodeTypeResolver;
use Parser\ParamParser;
use Parser\NamespaceParser;
use Complete\Resolver\NodeTypeResolver;

use Entity\FQCN;
use Entity\Index;
Expand All @@ -21,6 +22,7 @@
use PhpParser\Node\Expr\Assign;
use PhpParser\Node\Stmt\Use_;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\Namespace_;
use PhpParser\Node\Stmt\ClassMethod;
use PhpParser\Node\Expr\Closure;

Expand All @@ -29,13 +31,15 @@ public function __construct(
UseParser $useParser,
NodeTypeResolver $typeResolver,
CommentParser $commentParser,
ParamParser $paramParser
ParamParser $paramParser,
NamespaceParser $namespaceParser
){
$this->resultNodes = [];
$this->useParser = $useParser;
$this->typeResolver = $typeResolver;
$this->commentParser = $commentParser;
$this->paramParser = $paramParser;
$this->namespaceParser = $namespaceParser;
}
public function setLine($line){
$this->line = $line;
Expand All @@ -48,6 +52,9 @@ public function enterNode(Node $node){
if($node instanceof Class_){
$this->createScopeFromClass($node);
}
elseif($node instanceof Namespace_){
$this->namespaceParser->parse($node);
}
elseif($node instanceof ClassMethod){
$this->createScopeFromMethod($node);
}
Expand Down Expand Up @@ -197,4 +204,5 @@ protected function createScope(){
private $commentParser;
/** @property ParamParser */
private $paramParser;
private $namespaceParser;
}

0 comments on commit 2c4f0fc

Please sign in to comment.