Skip to content

Instantly share code, notes, and snippets.

@juzna
Created March 14, 2012 22:05
Show Gist options
  • Save juzna/2039906 to your computer and use it in GitHub Desktop.
Save juzna/2039906 to your computer and use it in GitHub Desktop.
PhpStorm inconsistent use proof
<?php
$tools = new \MyApp\MyModule\Tools;
$tools->getObject()->isThisAnObject(); // will show a warning because return type of getObject() won't be recognized correctly
<?php
namespace MyApp;
/**
*/
class Object {
function isThisAnObject() {
}
}
<?php
namespace MyApp\MyModule;
use MyApp;
/**
*/
class Tools {
/**
* Test - return type will be wrong here
* @return MyApp\Object
*/
public function getObject() {
$x = call_user_func('a');
return $x;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment