@@ -17,5 +17,5 @@ |
||
17 | 17 | /** |
18 | 18 | * @return bool gets a value indicating whether the value of this boolean value is true or false |
19 | 19 | */ |
20 | - public function getValue(): bool ; |
|
20 | + public function getValue(): bool; |
|
21 | 21 | } |
@@ -19,5 +19,5 @@ |
||
19 | 19 | /** |
20 | 20 | * @return DateTime gets the definition of this datetime value |
21 | 21 | */ |
22 | - public function getValue(): DateTime ; |
|
22 | + public function getValue(): DateTime; |
|
23 | 23 | } |
@@ -17,5 +17,5 @@ |
||
17 | 17 | /** |
18 | 18 | * @return float gets the definition of this floating value |
19 | 19 | */ |
20 | - public function getValue(): float ; |
|
20 | + public function getValue(): float; |
|
21 | 21 | } |
@@ -17,5 +17,5 @@ |
||
17 | 17 | /** |
18 | 18 | * @return float gets the definition of this decimal value |
19 | 19 | */ |
20 | - public function getValue(): float ; |
|
20 | + public function getValue(): float; |
|
21 | 21 | } |
@@ -17,5 +17,5 @@ |
||
17 | 17 | /** |
18 | 18 | * @return string[] gets the definition of this binary value |
19 | 19 | */ |
20 | - public function getValue(): array ; |
|
20 | + public function getValue(): array; |
|
21 | 21 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | public function getIterator() |
29 | 29 | { |
30 | 30 | rewind($this->memoryStream); |
31 | - while(false !== $char = fgetc($this->memoryStream)){ |
|
31 | + while (false !== $char = fgetc($this->memoryStream)) { |
|
32 | 32 | yield ord($char); |
33 | 33 | } |
34 | 34 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function offsetExists($offset) |
40 | 40 | { |
41 | - return is_int($offset) && 0 <= $offset && $offset < $this->length; |
|
41 | + return is_int($offset) && 0 <= $offset && $offset < $this->length; |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public function offsetGet($offset) |
48 | 48 | { |
49 | - if(!$this->offsetExists($offset)){ |
|
49 | + if (!$this->offsetExists($offset)) { |
|
50 | 50 | throw new ArgumentException(sprintf('%s is out of range', $offset)); |
51 | 51 | } |
52 | 52 | fseek($this->memoryStream, $offset); |
@@ -58,18 +58,18 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function offsetSet($offset, $value) |
60 | 60 | { |
61 | - if(!is_int($value) || $value <0 || $value > 255){ |
|
61 | + if (!is_int($value) || $value < 0 || $value > 255) { |
|
62 | 62 | throw new \InvalidArgumentException(sprintf('%s is an invalid value for a ByteArray', $value)); |
63 | 63 | } |
64 | - if($this->readonly){ |
|
64 | + if ($this->readonly) { |
|
65 | 65 | throw new InvalidOperationException('attempt to write to read only array'); |
66 | 66 | } |
67 | - if($offset !== null || $offset < 0 || $offset > $this->length ){ |
|
67 | + if ($offset !== null || $offset < 0 || $offset > $this->length) { |
|
68 | 68 | throw new \InvalidArgumentException('allowable offsets are between 0 and full legnth or null'); |
69 | 69 | } |
70 | - if(null === $offset){ |
|
70 | + if (null === $offset) { |
|
71 | 71 | fseek($this->memoryStream, 0, SEEK_END); |
72 | - }else { |
|
72 | + } else { |
|
73 | 73 | fseek($this->memoryStream, $offset); |
74 | 74 | } |
75 | 75 | fwrite($this->memoryStream, chr($value)); |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | // If we don't have the applied function we just assume that it will work. |
198 | 198 | $discoveredErrors = []; |
199 | 199 | return true; |
200 | - case ExpressionKind::If(): |
|
200 | + case ExpressionKind::If (): |
|
201 | 201 | assert($expression instanceof IIfExpression); |
202 | 202 | return self::TryAssertIfAsType($expression, $type, $context, $matchExactly, $discoveredErrors); |
203 | 203 | case ExpressionKind::IsType(): |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | iterable &$discoveredErrors |
296 | 296 | ): bool { |
297 | 297 | if (!$type->IsPrimitive()) { |
298 | - $discoveredErrors = [ |
|
298 | + $discoveredErrors = [ |
|
299 | 299 | new EdmError( |
300 | 300 | $expression->Location(), |
301 | 301 | EdmErrorCode::PrimitiveConstantExpressionNotValidForNonPrimitiveType(), |
@@ -467,8 +467,8 @@ discard block |
||
467 | 467 | assert($definition instanceof IStructuredType); |
468 | 468 | foreach ($definition->Properties() as $typeProperty) { |
469 | 469 | $expressionProperty = null; |
470 | - foreach($expression->getProperties() as $p) { |
|
471 | - if($p->getName() === $typeProperty->getName()) { |
|
470 | + foreach ($expression->getProperties() as $p) { |
|
471 | + if ($p->getName() === $typeProperty->getName()) { |
|
472 | 472 | $expressionProperty = $p; |
473 | 473 | break; |
474 | 474 | } |
@@ -787,7 +787,7 @@ discard block |
||
787 | 787 | $discoveredErrors |
788 | 788 | ); |
789 | 789 | default: |
790 | - $discoveredErrors = [ |
|
790 | + $discoveredErrors = [ |
|
791 | 791 | new EdmError( |
792 | 792 | $expression->Location(), |
793 | 793 | EdmErrorCode::ExpressionPrimitiveKindNotValidForAssertedType(), |
@@ -907,7 +907,7 @@ discard block |
||
907 | 907 | |
908 | 908 | if ($expressionType->getTypeKind()->isPrimitive() && $assertedType->getTypeKind()->isPrimitive()) { |
909 | 909 | $primitiveExpressionType = $expressionType; |
910 | - $primitiveAssertedType = $assertedType ; |
|
910 | + $primitiveAssertedType = $assertedType; |
|
911 | 911 | assert($primitiveExpressionType instanceof IPrimitiveType); |
912 | 912 | assert($primitiveAssertedType instanceof IPrimitiveType); |
913 | 913 | if (!self::PromotesTo( |
@@ -55,9 +55,9 @@ |
||
55 | 55 | |
56 | 56 | public static function VerifyNCName(string $name): bool{ |
57 | 57 | $length = strlen($name); |
58 | - for( $i = 1; $i < $length; $i++) |
|
58 | + for ($i = 1; $i < $length; $i++) |
|
59 | 59 | { |
60 | - if(!self::IsNCNameChar($name[$i])){ |
|
60 | + if (!self::IsNCNameChar($name[$i])) { |
|
61 | 61 | return false; |
62 | 62 | } |
63 | 63 | } |
@@ -305,10 +305,10 @@ discard block |
||
305 | 305 | if (self::$m_CharProperties != null) { |
306 | 306 | return; |
307 | 307 | } |
308 | - if(file_exists('XmlCharType.bin')){ |
|
308 | + if (file_exists('XmlCharType.bin')) { |
|
309 | 309 | $file = fopen('XmlCharType.bin', 'rb'); |
310 | 310 | self::$m_CharProperties = fopen('php://memory', 'w+b'); |
311 | - stream_copy_to_stream($file,self::$m_CharProperties); |
|
311 | + stream_copy_to_stream($file, self::$m_CharProperties); |
|
312 | 312 | fclose($file); |
313 | 313 | return; |
314 | 314 | } |
@@ -329,28 +329,28 @@ discard block |
||
329 | 329 | private static function SetProperties(string $ranges, int $value): void |
330 | 330 | { |
331 | 331 | assert(mb_strlen($ranges, 'UTF-8') % 2 === 0); |
332 | - for ($p = 0; $p < mb_strlen($ranges, 'UTF-8'); $p +=2) |
|
332 | + for ($p = 0; $p < mb_strlen($ranges, 'UTF-8'); $p += 2) |
|
333 | 333 | { |
334 | - $str1 = mb_substr($ranges,$p,1,'UTF-8'); |
|
335 | - $str2 = mb_substr($ranges,$p+1,1,'UTF-8'); |
|
334 | + $str1 = mb_substr($ranges, $p, 1, 'UTF-8'); |
|
335 | + $str2 = mb_substr($ranges, $p + 1, 1, 'UTF-8'); |
|
336 | 336 | for ($i = mb_ord($str1), |
337 | 337 | $last = mb_ord($str2); $i <= $last; $i++) |
338 | 338 | { |
339 | - if(!isset(self::$s_CharProperties[$i])){ |
|
339 | + if (!isset(self::$s_CharProperties[$i])) { |
|
340 | 340 | self::$s_CharProperties[$i] = $value; |
341 | 341 | } |
342 | 342 | self::$s_CharProperties[$i] |= $value; |
343 | 343 | } |
344 | 344 | } |
345 | 345 | } |
346 | - protected static function generateFile(){ |
|
346 | + protected static function generateFile() { |
|
347 | 347 | $fileArray = []; |
348 | - for($i = 0; $i < 65536; $i++){ |
|
348 | + for ($i = 0; $i < 65536; $i++) { |
|
349 | 349 | $fileArray[$i] = XmlCharType::$s_CharProperties[$i] ?? 0; |
350 | 350 | } |
351 | 351 | $bin = fopen(__DIR__ . DIRECTORY_SEPARATOR . 'XmlCharType.bin', 'w+b'); |
352 | 352 | self::$m_CharProperties = fopen('php://memory', 'w+b'); |
353 | - foreach($fileArray as $enum){ |
|
353 | + foreach ($fileArray as $enum) { |
|
354 | 354 | fwrite($bin, chr($enum)); |
355 | 355 | fwrite(self::$m_CharProperties, chr($enum)); |
356 | 356 | } |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | #endregion |
360 | 360 | |
361 | 361 | private static $instance = null; |
362 | - public static function Instance(){ |
|
362 | + public static function Instance() { |
|
363 | 363 | self::InitInstance(); |
364 | 364 | $umArray = new UnmanagedByteArray(self::$m_CharProperties); |
365 | 365 | return self::$instance ?? self::$instance = new self($umArray); |