Skip to content

Commit 3263370

Browse files
committed
reorder some protected and private methods
1 parent 0a65a10 commit 3263370

File tree

1 file changed

+39
-40
lines changed

1 file changed

+39
-40
lines changed

src/Codeception/Module/Laravel.php

Lines changed: 39 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,27 @@ public function _after(TestInterface $test)
257257
}
258258
}
259259

260+
/**
261+
* Returns a list of recognized domain names.
262+
* This elements of this list are regular expressions.
263+
*
264+
* @throws ReflectionException
265+
* @return string[]
266+
*/
267+
protected function getInternalDomains(): array
268+
{
269+
$internalDomains = [$this->getApplicationDomainRegex()];
270+
271+
/** @var Route $route */
272+
foreach ($this->getRoutes() as $route) {
273+
if (!is_null($route->domain())) {
274+
$internalDomains[] = $this->getDomainRegex($route);
275+
}
276+
}
277+
278+
return array_unique($internalDomains);
279+
}
280+
260281
/**
261282
* Does the application use the database?
262283
*/
@@ -284,46 +305,6 @@ private function checkBootstrapFileExists(): void
284305
}
285306

286307
/**
287-
* Register Laravel autoloaders.
288-
*/
289-
private function registerAutoloaders(): void
290-
{
291-
require $this->config['project_dir'] . $this->config['vendor_dir'] . DIRECTORY_SEPARATOR . 'autoload.php';
292-
}
293-
294-
/**
295-
* Revert back to the Codeception error handler,
296-
* because Laravel registers it's own error handler.
297-
*/
298-
private function revertErrorHandler(): void
299-
{
300-
$errorHandler = new ErrorHandler();
301-
set_error_handler([$errorHandler, 'errorHandler']);
302-
}
303-
304-
/**
305-
* Returns a list of recognized domain names.
306-
* This elements of this list are regular expressions.
307-
*
308-
* @throws ReflectionException
309-
* @return string[]
310-
*/
311-
protected function getInternalDomains(): array
312-
{
313-
$internalDomains = [$this->getApplicationDomainRegex()];
314-
315-
/** @var Route $route */
316-
foreach ($this->getRoutes() as $route) {
317-
if (!is_null($route->domain())) {
318-
$internalDomains[] = $this->getDomainRegex($route);
319-
}
320-
}
321-
322-
return array_unique($internalDomains);
323-
}
324-
325-
/**
326-
* @return string
327308
* @throws ReflectionException
328309
*/
329310
private function getApplicationDomainRegex(): string
@@ -347,4 +328,22 @@ private function getDomainRegex(Route $route): string
347328

348329
return $compiledRoute->getHostRegex();
349330
}
331+
332+
/**
333+
* Register Laravel autoloaders.
334+
*/
335+
private function registerAutoloaders(): void
336+
{
337+
require $this->config['project_dir'] . $this->config['vendor_dir'] . DIRECTORY_SEPARATOR . 'autoload.php';
338+
}
339+
340+
/**
341+
* Revert back to the Codeception error handler,
342+
* because Laravel registers it's own error handler.
343+
*/
344+
private function revertErrorHandler(): void
345+
{
346+
$errorHandler = new ErrorHandler();
347+
set_error_handler([$errorHandler, 'errorHandler']);
348+
}
350349
}

0 commit comments

Comments
 (0)