Skip to content

Commit 9c88bb7

Browse files
committed
Update code CQ
1 parent 58c3bf1 commit 9c88bb7

File tree

4 files changed

+5
-22
lines changed

4 files changed

+5
-22
lines changed

autoload/classes/class.Loader.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,15 +209,11 @@ protected function readFile($filepath) {
209209
$this->file = $this->getFile($filepath);
210210
if (false != $this->file) {
211211
foreach ($this->file as $lineNum => $line) {
212-
213212
// Get actually namespace
214213
// $this->getNamespace($line, $arr);
215-
//
216214
// Get actually class
217215
$this->getClass($filepath, $line, $arr, $lineNum);
218-
219216
if ($lineNum > MBT_CORE_AUTOLOAD_READ_MAX_LINES || $this->found == true) {
220-
221217
$this->found = false;
222218
break; // DEFAULT: 49 lines or by found = true, break the loop
223219
}

autoload/classes/class.LoaderHelper.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ class LoaderHelper {
4343
protected function loadIndex($classname, $filepath) {
4444

4545
$classname = (string) trim(mb_substr($classname, 0, strpos($classname, ' ')));
46-
4746
if ($classname AND ! in_array($classname, array_keys($this->loader))) {
4847
$this->loader[$classname] = $filepath;
4948
}
@@ -112,7 +111,6 @@ protected function getNamespace($line, $arr) {
112111

113112
// Get actually namespace
114113
$namespaceRegEx = '/((namespace)+\s*(' . preg_quote($this->splitInsatnce(true)) . ');)/';
115-
116114
if (preg_match_all($namespaceRegEx, $line, $arr)) {
117115
// Debug information
118116
$this->debugInfo[] = '<b>Namespace:</b> <span style="color:blue;">' . $arr[0][0] . '</span>';
@@ -134,12 +132,10 @@ protected function getClass($filepath, $line, $arr, $lineNum) {
134132
// Get actually class
135133
$classRegEx = '/((interface|abstract\s+class|class|trait)+\s+(' . preg_quote($this->splitInsatnce()) . ')(.*)\{?)/';
136134
if (preg_match_all($classRegEx, trim($line), $arr)) {
137-
138135
// Founded class
139136
$class = $arr[3][0];
140137
// Get pathinfo
141138
$info = pathinfo($filepath);
142-
143139
if (!isset($this->loader[$class]) && file_exists($filepath) && $info["extension"] == "php") {
144140
// Hold loader class and filepath
145141
$this->loader[$class] = $filepath;
@@ -172,7 +168,6 @@ protected function splitInsatnce($namespaceORclass = false) {
172168
$getLastForName = count($this->namespace) - 1;
173169
$classname = $this->namespace[$getLastForName];
174170
unset($this->namespace[$getLastForName]);
175-
176171
if ($namespaceORclass == true) {
177172
$return = implode('\\', $this->namespace);
178173
} else {
@@ -196,19 +191,13 @@ public function logInfo() {
196191
$output .= '<th>Namespace as Foldername (Instance) </th>';
197192
$output .= '<th>Load Time</th>';
198193
$output .= '</tr>';
199-
200194
if (file_exists(MBT_CORE_AUTOLOAD_LOG_LOGS)) {
201-
202195
$debugInfo = unserialize(file_get_contents(MBT_CORE_AUTOLOAD_LOG_LOGS));
203-
204196
if ($debugInfo) {
205-
206197
$counter = 0;
207198
foreach ($debugInfo as $key => $value) {
208-
209199
// $output .= '</tr><tr>';
210200
// $output .= '<td colspan="2" style="text-align:center;"><strong>' . $key . ' (' . count($value) . ')</strong></td>';
211-
212201
$i = 0;
213202
if (is_array($value)) {
214203
foreach ($value as $val => $v) {
@@ -218,7 +207,6 @@ public function logInfo() {
218207
$i++;
219208
}
220209
}
221-
222210
$counter++;
223211
}
224212
}
@@ -240,7 +228,6 @@ public function getDebug() {
240228
$output .= '<tr>';
241229
$output .= '<th>Debugging</th>';
242230
$output .= '</tr>';
243-
244231
if ($this->debugInfo) {
245232
$i = 0;
246233
foreach ($this->debugInfo as $key => $value) {

testclasses/classOne.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
class classOne {
66

77
public function method_from_class_one() {
8-
9-
echo '<p>I am Class "<b>' . __CLASS__ . '</b>" have a namespace <b>' . __NAMESPACE__ . '</b> and a method <b>' . __METHOD__ . '</b></p>';
8+
9+
echo "<p>I am Class <b>" . __CLASS__ . "</b> have a namespace <b>" . __NAMESPACE__ . "</b> and a method <b>" . __METHOD__ . "</b></p>";
1010
}
1111

12-
}
12+
}

testclasses/classThree.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
class three_class {
66

77
public function method_from_three_class() {
8-
9-
echo '<p>I am Class "<b>' . __CLASS__ . '</b>" have a namespace <b>' . __NAMESPACE__ . '</b> and a method <b>' . __METHOD__ . '</b></p>';
8+
9+
echo "<p>I am Class <b>" . __CLASS__ . "</b> have a namespace <b>" . __NAMESPACE__ . "</b> and a method <b>" . __METHOD__ . "</b></p>";
1010
}
1111

1212
}

0 commit comments

Comments
 (0)