Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit d63b4a5

Browse files
authored
Merge pull request #1 from imponeer/scrutinizer-patch-1
Scrutinizer Auto-Fixes
2 parents 31201aa + 0f08e07 commit d63b4a5

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

src/DataCache.php

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
*
1010
* @package Imponeer\ComposerCustomCommands
1111
*/
12-
final class DataCache
13-
{
12+
final class DataCache {
1413

1514
/**
1615
* Cache file
@@ -22,8 +21,7 @@ final class DataCache
2221
/**
2322
* DataCache constructor.
2423
*/
25-
public function __construct()
26-
{
24+
public function __construct() {
2725
$this->cache_file = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'commands.php';
2826
}
2927

@@ -32,8 +30,7 @@ public function __construct()
3230
*
3331
* @return DataCache
3432
*/
35-
public static function getInstance()
36-
{
33+
public static function getInstance() {
3734
return new self();
3835
}
3936

@@ -42,11 +39,10 @@ public static function getInstance()
4239
*
4340
* @param array $classes Classes list
4441
*/
45-
public function write(array $classes)
46-
{
42+
public function write(array $classes) {
4743
require_once dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . 'autoload.php';
4844

49-
$includes = empty($classes) ? array() : $this->getReflectionClassesFromStrings($classes);
45+
$includes = empty($classes)?array():$this->getReflectionClassesFromStrings($classes);
5046

5147
ob_start();
5248
require dirname(__DIR__) . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'commands.tpl.php';
@@ -63,8 +59,7 @@ public function write(array $classes)
6359
*
6460
* @return array
6561
*/
66-
private function getReflectionClassesFromStrings(array $classes)
67-
{
62+
private function getReflectionClassesFromStrings(array $classes) {
6863
$all_reflection_classes = [];
6964
foreach ($classes as $class) {
7065
foreach ($this->getFilesForClasses(new ReflectionClass($class)) as $name => $reflection_class) {
@@ -79,8 +74,7 @@ private function getReflectionClassesFromStrings(array $classes)
7974
*
8075
* @param ReflectionClass $class
8176
*/
82-
private function getFilesForClasses(ReflectionClass $class)
83-
{
77+
private function getFilesForClasses(ReflectionClass $class) {
8478
$ret = [];
8579
foreach ($class->getInterfaces() as $interface) {
8680
foreach ($this->getFilesForClasses($interface) as $class2 => $file) {
@@ -110,7 +104,7 @@ private function getFilesForClasses(ReflectionClass $class)
110104
*/
111105
public function read()
112106
{
113-
return file_exists($this->cache_file) ? include($this->cache_file) : array();
107+
return file_exists($this->cache_file)?include($this->cache_file):array();
114108
}
115109

116110
}

0 commit comments

Comments
 (0)