Re-format source code of Alias class

This commit is contained in:
Thach Nguyen
2018-01-27 03:21:47 +07:00
parent 042d341b65
commit e6f7ca7433
+11 -8
View File
@@ -71,7 +71,7 @@ class Alias
if (class_exists($class) || interface_exists($class)) { if (class_exists($class) || interface_exists($class)) {
$this->classes[] = $class; $this->classes[] = $class;
} else { } else {
echo "Class not exists: $class\r\n"; $this->error('Class not exists: ' . $class);
} }
} }
} }
@@ -86,11 +86,11 @@ class Alias
} }
/** /**
* Get the classtype, 'interface' or 'class' * Get the classType, 'interface' or 'class'
* *
* @return string * @return string
*/ */
public function getClasstype() public function getClassType()
{ {
return $this->classType; return $this->classType;
} }
@@ -117,10 +117,14 @@ class Alias
/** /**
* Return the short name (without namespace) * Return the short name (without namespace)
*
* @return string
*/ */
public function getShortName(){ public function getShortName()
{
return $this->short; return $this->short;
} }
/** /**
* Get the namespace from the alias * Get the namespace from the alias
* *
@@ -134,7 +138,7 @@ class Alias
/** /**
* Get the methods found by this Alias * Get the methods found by this Alias
* *
* @return array * @return array|Method[]
*/ */
public function getMethods() public function getMethods()
{ {
@@ -201,10 +205,10 @@ class Alias
//When the database connection is not set, some classes will be skipped //When the database connection is not set, some classes will be skipped
} catch (\PDOException $e) { } catch (\PDOException $e) {
$this->error( $this->error(
"PDOException: " . $e->getMessage() . "\nPlease configure your database connection correctly, or use the sqlite memory driver (-M). Skipping $facade." 'PDOException: ' . $e->getMessage() . "\nPlease configure your database connection correctly, or use the sqlite memory driver (-M). Skipping $facade."
); );
} catch (\Exception $e) { } catch (\Exception $e) {
$this->error("Exception: " . $e->getMessage() . "\nSkipping $facade."); $this->error('Exception: ' . $e->getMessage() . "\nSkipping $facade.");
} }
} }
@@ -251,7 +255,6 @@ class Alias
*/ */
protected function detectMethods() protected function detectMethods()
{ {
foreach ($this->classes as $class) { foreach ($this->classes as $class) {
$reflection = new \ReflectionClass($class); $reflection = new \ReflectionClass($class);