Compare commits

...
4 Commits
Author SHA1 Message Date
Barry vd. Heuvel eda37f3442 Catch PDO errors when getting drivers/connections 2013-07-12 14:39:12 +02:00
Barry vd. Heuvel e9cbd7e732 Allow 4.1 (and future version) 2013-07-04 14:30:33 +02:00
Barry vd. Heuvel ac6740f59f Change aliasing way back
Not really nice in NetBeans.
Also reference the calling class and show the implementing class in
comments (phpStorm will understand it anyways)
2013-07-04 14:26:17 +02:00
Barry vd. Heuvel 60ec740b15 Update CodeIntel link 2013-07-02 22:22:56 +02:00
3 changed files with 27 additions and 34 deletions
+4 -4
View File
@@ -11,11 +11,11 @@
],
"require": {
"php": ">=5.3.0",
"illuminate/support": "4.0.x",
"illuminate/console": "4.0.x",
"illuminate/filesystem": "4.0.x",
"illuminate/support": "4.x",
"illuminate/console": "4.x",
"illuminate/filesystem": "4.x",
"barryvdh/reflection-docblock": ">=2.0.1",
"symfony/class-loader": "2.3.*"
"symfony/class-loader": "~2.3"
},
"autoload": {
"psr-0": {
+1 -1
View File
@@ -8,7 +8,7 @@ If you don't want to generate it, you can add a pre-generated file to the root f
* Generated version: https://gist.github.com/barryvdh/5227822
Note: You do need CodeIntel for Sublime Text: https://github.com/Kronuz/SublimeCodeIntel
Note: You do need CodeIntel for Sublime Text: https://github.com/SublimeCodeIntel/SublimeCodeIntel
### Automatic phpDoc generation for Laravel Facades
@@ -224,19 +224,24 @@ exit('Only to be used as an helper for your IDE');\n\n";
}
public function getDriver($alias){
if($alias == "Auth"){
$driver = \Auth::driver();
}elseif($alias == "DB"){
$driver = \DB::connection();
}elseif($alias == "Cache"){
$driver = \Cache::driver();
}elseif($alias == "Queue"){
$driver = \Queue::connection();
}else{
try{
if($alias == "Auth"){
$driver = \Auth::driver();
}elseif($alias == "DB"){
$driver = \DB::connection();
}elseif($alias == "Cache"){
$driver = \Cache::driver();
}elseif($alias == "Queue"){
$driver = \Queue::connection();
}else{
return false;
}
return get_class($driver);
}catch(\Exception $e){
$this->error("Could not determine driver/connection for $alias.");
return false;
}
return get_class($driver);
}
/**
@@ -314,29 +319,17 @@ exit('Only to be used as an helper for your IDE');\n\n";
$output .= "){\r\n";
//Only return when not a constructor and not void.
$return = ($returnValue && $returnValue !== "void" && $method->name !== "__construct") ? 'return ' : '';
$return = ($returnValue && $returnValue !== "void" && $method->name !== "__construct") ? 'return' : '';
//Reference the 'real' function in the declaringclass
$declaringClass = $method->getDeclaringClass();
if($declaringClass->isAbstract()){
$declaringClass = $class;
$root = $class->getName();
if($declaringClass->name != $root){
$output .= "\t\t//Method inherited from $declaringClass->name\r\n";
}
$constructor = $declaringClass->getConstructor();
$root = $declaringClass->getName();
$output .= "\t\t\$root = new \\$root(";
if(!is_null($constructor)){
$constructorParams = array();
for($i=0;$i<$constructor->getNumberOfRequiredParameters();$i++){
$constructorParams[] = 'null';
}
$output .= implode($constructorParams, ',');
}
$output .= ");\n";
$output .= "\t\t$return\$root->";
$output .= "\t\t$return $root::";
//Write the default parameters in the function call
$output .= $method->name."(".implode($params, ", ").");\r\n";