clean code with php-cs-fixer

This commit is contained in:
Manuel Raynaud
2012-11-03 09:39:40 +01:00
parent 67fa4f6706
commit 43ec85bb1e
20 changed files with 273 additions and 322 deletions

View File

@@ -3,41 +3,42 @@
namespace Thelia\Autoload;
/**
*
*
* @author Manuel Raynaud <mraynaud@openstudio.fr>
*/
class TheliaApcUniversalClassLoader extends TheliaUniversalClassLoader {
class TheliaApcUniversalClassLoader extends TheliaUniversalClassLoader
{
private $prefix;
/**
* Constructor
*
*
* Come from Symfony\Component\ClassLoader\ApcUniversalClassLoader
*
* @param string $prefix
*
* @param string $prefix
* @throws \RuntimeException
*/
public function __construct($prefix) {
public function __construct($prefix)
{
if (!extension_loaded('apc')) {
throw new \RuntimeException('Unable to use ApcUniversalClassLoader as APC is not enabled.');
}
$this->prefix = $prefix;
}
/**
* Finds a file by class name while caching lookups to APC.
*
*
* Come from Symfony\Component\ClassLoader\ApcUniversalClassLoader
*
* @param string $class A class name to resolve to file
*
* @return string|null The path, if found
*/
public function findFile($class) {
public function findFile($class)
{
if (false === $file = apc_fetch($this->prefix.$class)) {
apc_store($this->prefix.$class, $file = parent::findFile($class));
}
@@ -45,4 +46,3 @@ class TheliaApcUniversalClassLoader extends TheliaUniversalClassLoader {
return $file;
}
}
?>