fix some CS

This commit is contained in:
Manuel Raynaud
2013-01-09 09:13:25 +01:00
parent a168082d54
commit 4e21c25867
26 changed files with 422 additions and 346 deletions

View File

@@ -56,8 +56,7 @@ class LoggerBundle extends Bundle
$kernel = $container->get('kernel');
if($kernel->isDebug())
{
if ($kernel->isDebug()) {
// $debug = function ($query, $parameters)
// {
//

View File

@@ -51,8 +51,7 @@ class ModelBundle extends Bundle
public function build(ContainerBuilder $container)
{
foreach(DIGenerator::genDiModel(realpath(THELIA_ROOT . "core/lib/Thelia/Model"), array('Base')) as $name => $class)
{
foreach (DIGenerator::genDiModel(realpath(THELIA_ROOT . "core/lib/Thelia/Model"), array('Base')) as $name => $class) {
$container->register('model.'.$name, $class)
->addArgument(new Reference("database"));
}

View File

@@ -26,8 +26,6 @@ use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
use Thelia\Log\Tlog;
/**
* First Bundle use in Thelia
* It initialize dependency injection container.
@@ -63,10 +61,8 @@ class NotORMBundle extends Bundle
$container->register('database','\Thelia\Database\NotORM')
->addArgument($pdo);
if(defined('THELIA_DB_CACHE') && !$kernel->isDebug())
{
switch(THELIA_DB_CACHE)
{
if (defined('THELIA_DB_CACHE') && !$kernel->isDebug()) {
switch (THELIA_DB_CACHE) {
case 'file':
$container->register('database_cache','\NotORM_Cache_File')
->addArgument($kernel->getCacheDir().'/database.php');
@@ -76,8 +72,7 @@ class NotORMBundle extends Bundle
->addArgument($kernel->getCacheDir().'/database_include.php');
break;
case 'apc':
if (extension_loaded('apc'))
{
if (extension_loaded('apc')) {
$container->register('database_cache','\NotORM_Cache_APC');
}
break;
@@ -85,8 +80,7 @@ class NotORMBundle extends Bundle
$container->register('database_cache','\NotORM_Cache_Session');
break;
case 'memcache':
if(class_exists('Memcache'))
{
if (class_exists('Memcache')) {
$container->register('database_cache','\NotORM_Cache_Memcache')
->addArgument(new \Memcache());
}
@@ -94,15 +88,11 @@ class NotORMBundle extends Bundle
}
if($container->hasDefinition('database_cache'))
{
if ($container->hasDefinition('database_cache')) {
$container->getDefinition('database')
->addMethodCall('setCache', array(new Reference('database_cache')));
}
}
}
}

View File

@@ -62,8 +62,7 @@ class Thelia extends Kernel
*/
public function getCacheDir()
{
if(defined('THELIA_ROOT'))
{
if (defined('THELIA_ROOT')) {
return THELIA_ROOT.'cache/'.$this->environment;
} else {
return parent::getCacheDir();
@@ -80,8 +79,7 @@ class Thelia extends Kernel
*/
public function getLogDir()
{
if(defined('THELIA_ROOT'))
{
if (defined('THELIA_ROOT')) {
return THELIA_ROOT.'log/';
} else {
return parent::getLogDir();

View File

@@ -43,7 +43,6 @@ class TheliaHttpKernel extends HttpKernel
$this->container = $container;
}
/**
* Handles a Request to convert it to a Response.
*

View File

@@ -25,7 +25,6 @@ namespace Thelia\Database;
use Thelia\Log\TlogInterface;
use Thelia\Database\NotORM\Result;
/**
*
* Class Thelia\Database\NotORM extending \NotORM library http://www.notorm.com/
@@ -51,8 +50,7 @@ class NotORM extends \NotORM
public function setDebug($debug)
{
if(is_callable($debug))
{
if (is_callable($debug)) {
$this->debug = $debug;
} else {
$this->debug = true;
@@ -64,11 +62,13 @@ class NotORM extends \NotORM
* @param array (["condition"[, array("value")]]) passed to NotORM_Result::where()
* @return NotORM_Result
*/
function __call($table, array $where) {
public function __call($table, array $where)
{
$return = new Result($this->structure->getReferencingTable($table, ''), $this);
if ($where) {
call_user_func_array(array($return, 'where'), $where);
}
return $return;
}
}

View File

@@ -4,7 +4,8 @@ namespace Thelia\Database\NotORM;
class Result extends \NotORM_Result
{
protected function query($query, $parameters) {
protected function query($query, $parameters)
{
if ($this->notORM->debug) {
if (!is_callable($this->notORM->debug)) {
$debug = "$query;";
@@ -23,8 +24,7 @@ class Result extends \NotORM_Result
}
}
if($this->notORM->logger !== false)
{
if ($this->notORM->logger !== false) {
$this->notORM->logger->debug($query);
$this->notORM->logger->debug($parameters);
}
@@ -34,8 +34,10 @@ class Result extends \NotORM_Result
$this->notORM->logger->fatal($this->notORM->errorCode());
$this->notORM->logger->fatal(print_r($this->notORM->errorInfo(), true));
$this->notORM->logger->fatal(print_r($return->errorInfo(), true));
return false;
}
return $return;
}
}

View File

@@ -23,8 +23,8 @@
namespace Thelia\Log;
abstract class AbstractTlogDestination {
abstract class AbstractTlogDestination
{
//Tableau de TlogDestinationConfig paramétrant la destination
protected $_configs;
@@ -36,7 +36,8 @@ abstract class AbstractTlogDestination {
protected $configModel;
public function __construct() {
public function __construct()
{
$this->_configs = array();
$this->_logs = array();
@@ -48,9 +49,10 @@ abstract class AbstractTlogDestination {
}
//Affecte une valeur à une configuration de la destination
public function set_config($nom, $valeur) {
foreach($this->_configs as $config) {
if($config->nom == $nom) {
public function set_config($nom, $valeur)
{
foreach ($this->_configs as $config) {
if ($config->nom == $nom) {
$config->valeur = $valeur;
// Appliquer les changements
$this->configurer($config);
@@ -58,6 +60,7 @@ abstract class AbstractTlogDestination {
return true;
}
}
return false;
}
@@ -72,36 +75,40 @@ abstract class AbstractTlogDestination {
}
//Récupère la valeur affectée à une configuration de la destination
public function get_config($nom) {
foreach($this->_configs as $config) {
if($config->nom == $nom) {
public function get_config($nom)
{
foreach ($this->_configs as $config) {
if ($config->nom == $nom) {
return $config->valeur;
}
}
return false;
}
public function get_configs() {
public function get_configs()
{
return $this->_configs;
}
public function mode_back_office($bool) {
public function mode_back_office($bool)
{
$this->flag_back_office = $bool;
}
//Ajoute une ligne de logs à la destination
public function ajouter($string) {
public function ajouter($string)
{
$this->_logs[] = $string;
}
protected function inserer_apres_body(&$res, $logdata) {
protected function inserer_apres_body(&$res, $logdata)
{
$match = array();
if (preg_match("/(<body[^>]*>)/i", $res, $match)) {
$res = str_replace($match[0], $match[0] . "\n" . $logdata, $res);
}
else {
} else {
$res = $logdata . $res;
}
}
@@ -109,7 +116,8 @@ abstract class AbstractTlogDestination {
// Demande à la destination de se configurer pour être prête
// a fonctionner. Si $config est != false, celà indique
// que seul le paramètre de configuration indiqué a été modifié.
protected function configurer($config = false) {
protected function configurer($config = false)
{
// Cette methode doit etre surchargée si nécessaire.
}

View File

@@ -26,8 +26,8 @@ namespace Thelia\Log\Destination;
use Thelia\Log\AbstractTlogDestination;
use Thelia\Log\TlogDestinationConfig;
class TlogDestinationFile extends AbstractTlogDestination {
class TlogDestinationFile extends AbstractTlogDestination
{
// Nom des variables de configuration
// ----------------------------------
const VAR_PATH_FILE = "tlog_destinationfile_path";
@@ -39,21 +39,22 @@ class TlogDestinationFile extends AbstractTlogDestination {
protected $path_defaut = false;
protected $fh = false;
public function __construct($configModel = null) {
public function __construct($configModel = null)
{
$this->path_defaut = THELIA_ROOT . "log/" . self::TLOG_DEFAULT_NAME;
$this->setConfigModel($configModel);
parent::__construct();
}
public function configurer($config = false) {
public function configurer($config = false)
{
$file_path = $this->get_config(self::VAR_PATH_FILE);
$mode = strtolower($this->get_config(self::VAR_MODE)) == 'a' ? 'a' : 'w';
if (! empty($file_path)) {
if (! is_file($file_path)) {
$dir = dirname($file_path);
if(! is_dir($dir)) {
if (! is_dir($dir)) {
mkdir($dir, 0777, true);
}
}
@@ -64,15 +65,18 @@ class TlogDestinationFile extends AbstractTlogDestination {
}
}
public function get_titre() {
public function get_titre()
{
return "Text File";
}
public function get_description() {
public function get_description()
{
return "Store logs into text file";
}
public function get_configs() {
public function get_configs()
{
return array(
new TlogDestinationConfig(
self::VAR_PATH_FILE,
@@ -93,13 +97,15 @@ class TlogDestinationFile extends AbstractTlogDestination {
);
}
public function ajouter($texte) {
public function ajouter($texte)
{
if ($this->fh) {
fwrite($this->fh, $texte."\n");
}
}
public function ecrire(&$res) {
public function ecrire(&$res)
{
if ($this->fh) @fclose($this->fh);
$this->fh = false;

View File

@@ -25,8 +25,8 @@ namespace Thelia\Log\Destination;
use Thelia\Log\AbstractTlogDestination;
class TlogDestinationHtml extends AbstractTlogDestination {
class TlogDestinationHtml extends AbstractTlogDestination
{
// Nom des variables de configuration
// ----------------------------------
const VAR_STYLE = "tlog_destinationhtml_style";
@@ -34,24 +34,29 @@ class TlogDestinationHtml extends AbstractTlogDestination {
private $style;
public function __construct() {
public function __construct()
{
parent::__construct();
}
public function configurer($config = false) {
public function configurer($config = false)
{
$this->style = $this->get_config(self::VAR_STYLE);
}
public function get_titre() {
public function get_titre()
{
return "Affichage direct dans la page, en HTML";
}
public function get_description() {
public function get_description()
{
return "Permet d'afficher les logs directement dans la page resultat, avec une mise en forme HTML.";
}
public function get_configs() {
public function get_configs()
{
// return array(
// new TlogDestinationConfig(
// self::VAR_STYLE,
@@ -63,8 +68,8 @@ class TlogDestinationHtml extends AbstractTlogDestination {
// );
}
public function ecrire(&$res) {
public function ecrire(&$res)
{
$block = sprintf('<pre class="tlog-trace" style="%s">%s</pre>', $this->style, htmlspecialchars(implode("\n", $this->_logs)));
$this->inserer_apres_body($res, $block);

View File

@@ -25,21 +25,25 @@ namespace Thelia\Log\Destination;
use Thelia\Log\AbstractTlogDestination;
class TlogDestinationNull extends AbstractTlogDestination {
public function get_titre() {
class TlogDestinationNull extends AbstractTlogDestination
{
public function get_titre()
{
return "Trou noir";
}
public function get_description() {
public function get_description()
{
return "Cette destination ne provoque aucune sortie";
}
public function ajouter($string) {
public function ajouter($string)
{
// Rien
}
public function ecrire(&$res) {
public function ecrire(&$res)
{
// Rien
}
}

View File

@@ -25,26 +25,30 @@ namespace Thelia\Log\Destination;
use Thelia\Log\AbstractTlogDestination;
class TlogDestinationText extends AbstractTlogDestination {
public function __construct() {
class TlogDestinationText extends AbstractTlogDestination
{
public function __construct()
{
parent::__construct();
}
public function get_titre() {
public function get_titre()
{
return "Affichage direct dans la page, en texte brut";
}
public function get_description() {
public function get_description()
{
return "Permet d'afficher les logs directement dans la page resultat, au format texte brut.";
}
public function ajouter($texte) {
public function ajouter($texte)
{
echo $texte."\n";
}
public function ecrire(&$res) {
public function ecrire(&$res)
{
// Rien
}
}

View File

@@ -106,7 +106,8 @@ class Tlog Implements TlogInterface
// return self::$instance;
// }
protected function init() {
protected function init()
{
$config = $this->container->get("model.config");
$level = $config->read(self::VAR_LEVEL, self::DEFAULT_LEVEL);
@@ -131,7 +132,8 @@ class Tlog Implements TlogInterface
// Configuration
// -------------
public function set_destinations($destinations) {
public function set_destinations($destinations)
{
if (! empty($destinations)) {
$this->destinations = array();
@@ -141,40 +143,44 @@ class Tlog Implements TlogInterface
}
}
public function set_level($level) {
public function set_level($level)
{
$this->level = $level;
}
public function set_prefixe($prefixe) {
public function set_prefixe($prefixe)
{
$this->prefixe = $prefixe;
}
public function set_files($files) {
public function set_files($files)
{
$this->files = explode(";", $files);
$this->all_files = in_array('*', $this->files);
}
public function set_ip($ips) {
public function set_ip($ips)
{
if (! empty($ips) && ! in_array($_SERVER['REMOTE_ADDR'], explode(";", $ips))) $this->level = self::MUET;
}
public function set_show_redirect($bool) {
public function set_show_redirect($bool)
{
$this->show_redirect = $bool;
}
// Configuration d'une destination
public function set_config($destination, $param, $valeur) {
public function set_config($destination, $param, $valeur)
{
if (isset($this->destinations[$destination])) {
$this->destinations[$destination]->set_config($param, $valeur);
}
}
// Configuration d'une destination
public function get_config($destination, $param) {
public function get_config($destination, $param)
{
if (isset($this->destinations[$destination])) {
return $this->destinations[$destination]->get_config($param);
}
@@ -185,7 +191,8 @@ class Tlog Implements TlogInterface
// Methodes d'accès aux traces
// ---------------------------
public function trace() {
public function trace()
{
if ($this->level > self::TRACE)
return;
@@ -194,7 +201,8 @@ class Tlog Implements TlogInterface
$this->out("TRACE", $args);
}
public function debug() {
public function debug()
{
if ($this->level > self::DEBUG)
return;
@@ -203,7 +211,8 @@ class Tlog Implements TlogInterface
$this->out("DEBUG", $args);
}
public function info() {
public function info()
{
if ($this->level > self::INFO)
return;
@@ -212,7 +221,8 @@ class Tlog Implements TlogInterface
$this->out("INFO", $args);
}
public function warning() {
public function warning()
{
if ($this->level > self::WARNING)
return;
@@ -221,7 +231,8 @@ class Tlog Implements TlogInterface
$this->out("WARNING", $args);
}
public function error() {
public function error()
{
if ($this->level > self::ERROR)
return;
@@ -230,7 +241,8 @@ class Tlog Implements TlogInterface
$this->out("ERREUR", $args);
}
public function fatal() {
public function fatal()
{
if ($this->level > self::FATAL)
return;
@@ -240,27 +252,28 @@ class Tlog Implements TlogInterface
}
// Mode back office
public static function mode_back_office($booleen) {
foreach(Tlog::instance()->destinations as $dest) {
public static function mode_back_office($booleen)
{
foreach (Tlog::instance()->destinations as $dest) {
$dest->mode_back_office($booleen);
}
}
// Ecriture finale
public function ecrire(&$res) {
public function ecrire(&$res)
{
self::$ecrire_effectue = true;
// Muet ? On ne fait rien
if ($this->level == self::MUET) return;
foreach($this->destinations as $dest) {
foreach ($this->destinations as $dest) {
$dest->ecrire($res);
}
}
public function ecrire_si_exit() {
public function ecrire_si_exit()
{
// Si les infos de debug n'ont pas été ecrites, le faire maintenant
if (self::$ecrire_effectue === false) {
@@ -272,8 +285,8 @@ class Tlog Implements TlogInterface
}
}
public function afficher_redirections($url) {
public function afficher_redirections($url)
{
if ($this->level != self::MUET && $this->show_redirect) {
echo "
<html>
@@ -285,16 +298,15 @@ class Tlog Implements TlogInterface
";
return true;
}
else {
} else {
return false;
}
}
// Permet de déterminer si la trace est active, en prenant en compte
// le level et le filtrage par fichier
public function active($level) {
public function active($level)
{
if ($this->level <= $level) {
$origine = $this->trouver_origine();
@@ -309,26 +321,27 @@ class Tlog Implements TlogInterface
return false;
}
public function is_file_active($file) {
public function is_file_active($file)
{
return ($this->all_files || in_array($file, $this->files)) && ! in_array("!$file", $this->files);
}
/* -- Methodes privees ---------------------------------------- */
// Adapté de LoggerLoginEvent dans log4php
private function trouver_origine() {
private function trouver_origine()
{
$origine = array();
if(function_exists('debug_backtrace')) {
if (function_exists('debug_backtrace')) {
$trace = debug_backtrace();
$prevHop = null;
// make a downsearch to identify the caller
$hop = array_pop($trace);
while($hop !== null) {
if(isset($hop['class'])) {
while ($hop !== null) {
if (isset($hop['class'])) {
// we are sometimes in functions = no class available: avoid php warning here
$className = $hop['class'];
@@ -359,8 +372,8 @@ class Tlog Implements TlogInterface
return $origine;
}
private function out($level, $tabargs) {
private function out($level, $tabargs)
{
$text = '';
foreach ($tabargs as $arg) {
@@ -384,7 +397,7 @@ class Tlog Implements TlogInterface
$trace = $prefixe . $text;
foreach($this->destinations as $dest) {
foreach ($this->destinations as $dest) {
$dest->ajouter($trace);
}
@@ -397,16 +410,13 @@ class Tlog Implements TlogInterface
* @param type $destinations
* @param array $actives array containing classes instanceof AbstractTlogDestination
*/
protected function loadDestinations(&$destinations, array $actives = NULL) {
foreach($actives as $active)
{
if(class_exists($active))
protected function loadDestinations(&$destinations, array $actives = NULL)
{
foreach ($actives as $active) {
if (class_exists($active)) {
$class = new $active($this->container->get('model.config'));
if(!$class instanceof AbstractTlogDestination)
{
if (!$class instanceof AbstractTlogDestination) {
throw new \UnexpectedValueException($active." must extends Thelia\Tlog\AbstractTlogDestination");
}

View File

@@ -35,8 +35,8 @@ class TlogDestinationConfig
public $type;
public $valeur;
public function __construct($nom, $titre, $label, $defaut, $type, $config = null) {
public function __construct($nom, $titre, $label, $defaut, $type, $config = null)
{
$this->nom = $nom;
$this->titre = $titre;
$this->label = $label;
@@ -45,8 +45,7 @@ class TlogDestinationConfig
// @$this->charger();
if($config)
{
if ($config) {
$this->valeur = $config->read($this->nom, $this->defaut);
}
}

View File

@@ -2,7 +2,6 @@
namespace Thelia\Log;
Interface TlogInterface
{

View File

@@ -6,50 +6,45 @@ use Thelia\Model\Base\Base;
class Accessory extends Base
{
protected $id;
protected $product_id;
protected $accessory;
protected $position;
protected $properties = array(
"id",
"product_id",
"accessory",
"position"
);
public function getId() {
return $this->id;
}
public function setId($id) {
$this->id = $id;
}
public function getProductId() {
public function getProductId()
{
return $this->product_id;
}
public function setProductId($product_id) {
public function setProductId($product_id)
{
$this->product_id = $product_id;
}
public function getAccessory() {
public function getAccessory()
{
return $this->accessory;
}
public function setAccessory($accessory) {
public function setAccessory($accessory)
{
$this->accessory = $accessory;
}
public function getPosition() {
public function getPosition()
{
return $this->position;
}
public function setPosition($position) {
public function setPosition($position)
{
$this->position = $position;
}
}

View File

@@ -27,6 +27,11 @@ namespace Thelia\Model\Base;
*/
abstract class Base
{
/**
* Primary key
* @var int
*/
protected $id;
/**
*
* @var \NotORM
@@ -45,15 +50,21 @@ abstract class Base
*/
protected $updated_at;
/**
*
* @var string date when the record had been saved
*/
protected $created_at;
/**
*
* base properties for all models
*
* @var array
*/
private $baseProperties = array(
"created_at",
"update_at"
);
/**
*
@@ -61,43 +72,96 @@ abstract class Base
*
* @param \NotORM $NotORM
*/
public function __construct(\NotORM $NotORM) {
public function __construct(\NotORM $NotORM)
{
$this->db = $NotORM;
$this->table = $this->getTableName();
}
public function getUpdatedAt() {
public function getUpdatedAt()
{
return $this->updated_at;
}
public function setUpdatedAt($updated_at) {
public function setUpdatedAt($updated_at)
{
$this->updated_at = $updated_at;
}
public function getCreatedAt() {
public function getCreatedAt()
{
return $this->created_at;
}
public function setCreatedAt($created_at) {
public function setCreatedAt($created_at)
{
$this->created_at = $created_at;
}
private function getBaseProperties()
{
return $this->baseProperties;
}
public function getProperties()
{
return $this->properties;
}
public function getId()
{
return $this->id;
}
public function setId($id)
{
$this->id = $id;
}
/**
*
* @return \NotORM
*/
public function getDb() {
public function getDb()
{
return $this->db;
}
public function getTable() {
public function getTable()
{
return $this->table;
}
public function save()
{
$this->updated_at = $this->created_at = date('Y-m-d H:i:s');
$values = $this->prepare();
// $this->db->insert_update(
// array("id", $this->getId()),
// $values,
//
// );
}
private function prepare()
{
$properties = array_merge($this->getBaseProperties(), $this->getProperties());
$values = array();
foreach ($properties as $property) {
$values[$property] = $this->$property;
}
return $values;
}
public function isNew()
{
return $this->getId() ? false:true;
}
/**
@@ -126,6 +190,7 @@ abstract class Base
$tmp = str_replace('::', '/', $tmp);
$tmp = self::pregtr($tmp, array('/([A-Z]+)([A-Z][a-z])/' => '\\1_\\2',
'/([a-z\d])([A-Z])/' => '\\1_\\2'));
return strtolower($tmp);
}

View File

@@ -21,7 +21,6 @@
/* */
/*************************************************************************************/
namespace Thelia\Tests\Log;
use Thelia\Log\Tlog;
@@ -33,7 +32,8 @@ class TlogTest extends \PHPUnit_Framework_TestCase
protected $regex = "/(\\d)(.)(\\s+)((?:[a-z][a-z]+))(\\s+)(\\[.*?\\])(\\s+)(\\{.*?\\})(\\s+)((?:2|1)\\d{3}(?:-|\\/)(?:(?:0[1-9])|(?:1[0-2]))(?:-|\\/)(?:(?:0[1-9])|(?:[1-2][0-9])|(?:3[0-1]))(?:T|\\s)(?:(?:[0-1][0-9])|(?:2[0-3])):(?:[0-5][0-9]):(?:[0-5][0-9]))(.)(\\s+)(%s)/is";
public function setUp() {
public function setUp()
{
parent::setUp();
$_SERVER['REMOTE_ADDR'] = '::1';
@@ -50,7 +50,6 @@ class TlogTest extends \PHPUnit_Framework_TestCase
->with($this->stringContains("logger.class"))
->will($this->returnValue("Thelia\Log\Tlog"));
$this->logger = new Tlog($containerMock);
$this->logger->set_destinations("Thelia\Log\Destination\TlogDestinationText");
@@ -179,10 +178,10 @@ class TlogTest extends \PHPUnit_Framework_TestCase
}
}
class ConfigModel
{
public function __call($name, $arguments) {
public function __call($name, $arguments)
{
return $arguments[1];
}
}

View File

@@ -68,6 +68,5 @@ class DIGeneratorTest extends \PHPUnit_Framework_TestCase
{
$models = DIGenerator::genDiModel(__DIR__ . '/wrongDirectory');
}
}

View File

@@ -2,6 +2,6 @@
namespace Thelia\Tests\Tools\_files;
class A {
class A
{
}

View File

@@ -39,8 +39,7 @@ class DIGenerator
{
if(!is_string($directory)) return array();
if(!is_dir($directory))
{
if (!is_dir($directory)) {
throw new \RuntimeException($directory." is not a valid directory");
}
@@ -48,8 +47,7 @@ class DIGenerator
$files = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($directory));
foreach($files as $file)
{
foreach ($files as $file) {
//$file is instance of SplFileInfo
if(!$file->isFile()) continue;
@@ -57,12 +55,10 @@ class DIGenerator
$classes = self::findClasses($filePath);
foreach($classes as $class)
{
foreach ($classes as $class) {
$classInfo = new \ReflectionClass($class);
$shortName = $classInfo->getShortName();
if(!in_array($shortName, $exclude))
{
if (!in_array($shortName, $exclude)) {
$results[$shortName] = $class;
}
}