@@ -26,7 +26,7 @@ |
||
| 26 | 26 | |
| 27 | 27 | public function toArray() |
| 28 | 28 | { |
| 29 | - return array_map(function ($value) { |
|
| 29 | + return array_map(function($value) { |
|
| 30 | 30 | return $value instanceof Arrayable || $value instanceof IlluminateArrayable ? $value->toArray() : $value; |
| 31 | 31 | }, $this->items); |
| 32 | 32 | } |
@@ -90,16 +90,16 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | protected function getCalculatedAttributes() |
| 92 | 92 | { |
| 93 | - return $this->collect($this->calculatedAttributes())->mapWithKeys(function ($attribute) { |
|
| 93 | + return $this->collect($this->calculatedAttributes())->mapWithKeys(function($attribute) { |
|
| 94 | 94 | return [$attribute => $this->{'get' . lcfirst($attribute) . 'Attribute'}()]; |
| 95 | 95 | })->toArray(); |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | protected function calculatedAttributes() |
| 99 | 99 | { |
| 100 | - return $this->collect($this->getAttributeMethods())->map(function ($method) { |
|
| 100 | + return $this->collect($this->getAttributeMethods())->map(function($method) { |
|
| 101 | 101 | return $this->getAttributeNameFromMethod($method); |
| 102 | - })->filter(function ($attribute) { |
|
| 102 | + })->filter(function($attribute) { |
|
| 103 | 103 | return !$this->hasProperty($attribute) && !$this->hasUnmappedAttribute($attribute); |
| 104 | 104 | })->values()->toArray(); |
| 105 | 105 | } |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | protected function hasAttributeMethod($attribute) |
| 113 | 113 | { |
| 114 | - return $this->collect($this->getAttributeMethods())->filter(function ($method) use ($attribute) { |
|
| 114 | + return $this->collect($this->getAttributeMethods())->filter(function($method) use ($attribute) { |
|
| 115 | 115 | return $this->getAttributeNameFromMethod($method) === $attribute; |
| 116 | 116 | })->isNotEmpty(); |
| 117 | 117 | } |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | protected function getAttributeMethods() |
| 125 | 125 | { |
| 126 | - return $this->collect(get_class_methods(get_called_class()))->filter(function ($method) { |
|
| 126 | + return $this->collect(get_class_methods(get_called_class()))->filter(function($method) { |
|
| 127 | 127 | return substr($method, 0, 3) === 'get' && substr($method, -9) === 'Attribute' && $method !== 'getAttribute'; |
| 128 | 128 | })->values()->toArray(); |
| 129 | 129 | } |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | |
| 298 | 298 | protected function getAncestorProperty($property_name) |
| 299 | 299 | { |
| 300 | - return $this->collect(class_parents($this))->map(function ($class) use ($property_name) { |
|
| 300 | + return $this->collect(class_parents($this))->map(function($class) use ($property_name) { |
|
| 301 | 301 | return (new ReflectionClass($class))->getDefaultProperties()[$property_name] ?? []; |
| 302 | 302 | })->values()->collapse()->toArray(); |
| 303 | 303 | } |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | |
| 38 | 38 | public function __construct(array $attributes = []) |
| 39 | 39 | { |
| 40 | - $this->attribute_casting['softwareElementState'] = function ($value) { |
|
| 40 | + $this->attribute_casting['softwareElementState'] = function($value) { |
|
| 41 | 41 | return SoftwareElementState::string($value); |
| 42 | 42 | }; |
| 43 | 43 | |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | |
| 45 | 45 | public function __construct(array $attributes = []) |
| 46 | 46 | { |
| 47 | - $this->attribute_casting['biosCharacteristics'] = function ($values) { |
|
| 47 | + $this->attribute_casting['biosCharacteristics'] = function($values) { |
|
| 48 | 48 | $characteristics = []; |
| 49 | 49 | |
| 50 | 50 | foreach ($values as $constant) { |
@@ -1,17 +1,17 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | return [ |
| 4 | - 'default' => 'local', |
|
| 4 | + 'default' => 'local', |
|
| 5 | 5 | |
| 6 | - 'servers' => [ |
|
| 7 | - 'local' => [ |
|
| 8 | - 'server' => '.', |
|
| 9 | - 'namespace' => 'Root\CIMv2', |
|
| 10 | - 'user' => null, |
|
| 11 | - 'password' => null, |
|
| 12 | - 'locale' => null, |
|
| 13 | - 'authority' => null, |
|
| 14 | - 'security_flags' => null, |
|
| 15 | - ] |
|
| 16 | - ] |
|
| 6 | + 'servers' => [ |
|
| 7 | + 'local' => [ |
|
| 8 | + 'server' => '.', |
|
| 9 | + 'namespace' => 'Root\CIMv2', |
|
| 10 | + 'user' => null, |
|
| 11 | + 'password' => null, |
|
| 12 | + 'locale' => null, |
|
| 13 | + 'authority' => null, |
|
| 14 | + 'security_flags' => null, |
|
| 15 | + ] |
|
| 16 | + ] |
|
| 17 | 17 | ]; |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | $connection = connection($connection, null, $this->config); |
| 39 | 39 | |
| 40 | 40 | /** @var ComTraceSubject $caller */ |
| 41 | - $caller = $this->callStack->getStackCollection()->first(function (ComCall $call) { |
|
| 41 | + $caller = $this->callStack->getStackCollection()->first(function(ComCall $call) { |
|
| 42 | 42 | return $call->getCaller()->getClass() === SWbemLocator::class; |
| 43 | 43 | })->getCaller(); |
| 44 | 44 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $reflectionClass = new ReflectionClass($class = new $this->class_name); |
| 39 | 39 | |
| 40 | 40 | $this->properties = (new ArrayCollection($reflectionClass->getProperties()))->mapWithKeys( |
| 41 | - function (ReflectionProperty $property) use ($class, $reflectionClass) { |
|
| 41 | + function(ReflectionProperty $property) use ($class, $reflectionClass) { |
|
| 42 | 42 | return [$property->name => [ |
| 43 | 43 | 'name' => $property->name, |
| 44 | 44 | 'origin' => $this->getPropertyOrigin($property, $reflectionClass)->getName(), |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | 'value' => $class->getAttribute($property->name), |
| 48 | 48 | ]]; |
| 49 | 49 | } |
| 50 | - )->diffKeys($class->getHidden())->filter(function ($property) { |
|
| 50 | + )->diffKeys($class->getHidden())->filter(function($property) { |
|
| 51 | 51 | return $property['origin'] !== Win32Model::class; |
| 52 | 52 | }); |
| 53 | 53 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | while ($count) { |
| 35 | 35 | $modelFakes->add(new ModelFake([ |
| 36 | 36 | 'properties' => $factory->fillAttributes(new ModelProperties($class_name)), |
| 37 | - 'derivations' => array_filter(class_parents($class_name), function ($parent) { |
|
| 37 | + 'derivations' => array_filter(class_parents($class_name), function($parent) { |
|
| 38 | 38 | return $parent !== Win32Model::class; |
| 39 | 39 | }), |
| 40 | 40 | 'qualifiers' => new ArrayCollection([ |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | protected function fillAttributes(ModelProperties $details) |
| 76 | 76 | { |
| 77 | - return $details->getProperties()->map(function ($property) { |
|
| 77 | + return $details->getProperties()->map(function($property) { |
|
| 78 | 78 | $value = null; |
| 79 | 79 | |
| 80 | 80 | if (is_array($property['value']) && empty($property['value'])) { |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | protected static function buildObjects(ModelFakeCollection $collection) |
| 24 | 24 | { |
| 25 | - return new ArrayIterator($collection->map(function (ModelFake $modelFake) { |
|
| 25 | + return new ArrayIterator($collection->map(function(ModelFake $modelFake) { |
|
| 26 | 26 | return new VariantWrapper( |
| 27 | 27 | VARIANTFake::withResponse('Properties_', static::buildProperties($modelFake)) |
| 28 | 28 | ->addResponse('Derivation_', $modelFake->get('derivations')) |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | protected static function buildProperties(ModelFake $modelFake) |
| 55 | 55 | { |
| 56 | - $properties = $modelFake->get('properties')->map(function ($property) { |
|
| 56 | + $properties = $modelFake->get('properties')->map(function($property) { |
|
| 57 | 57 | return new VariantWrapper( |
| 58 | 58 | VARIANTFake::withResponse('Name', $property['Name']) |
| 59 | 59 | ->addResponse('Value', $property['Value']) |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | protected static function buildQualifiers(ModelFake $modelFake) |
| 68 | 68 | { |
| 69 | - $qualifiers = $modelFake->get('qualifiers')->map(function ($qualifier) { |
|
| 69 | + $qualifiers = $modelFake->get('qualifiers')->map(function($qualifier) { |
|
| 70 | 70 | return new VariantWrapper( |
| 71 | 71 | VARIANTFake::withResponse('Name', $qualifier['Name']) |
| 72 | 72 | ->addResponse('Value', $qualifier['Value']) |