Skip to content

Commit

Permalink
Merge pull request #147 from microsoft/dev
Browse files Browse the repository at this point in the history
Release 1.3.1
  • Loading branch information
SilasKenneth authored May 2, 2024
2 parents a8dbca9 + 0388f90 commit 951eb57
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 13 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

## [1.3.1]

### Added

### Changed
- Changed method visibility in the serialization helper traits to Private. [#134](https://github.com/microsoft/kiota-abstractions-php/pull/134)

## [1.3.0]

### Added
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ run `composer require microsoft/kiota-abstractions` or add the following to your
```Shell
{
"require": {
"microsoft/kiota-abstractions": "^1.3.0"
"microsoft/kiota-abstractions": "^1.3.1"
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion src/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

final class Constants
{
public const VERSION = '1.3.0';
public const VERSION = '1.3.1';
}
2 changes: 1 addition & 1 deletion src/Serialization/ParseNodeFromStringTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ trait ParseNodeFromStringTrait
/**
* @throws Exception
*/
public function parseDateIntervalFromString(string $value): DateInterval
private function parseDateIntervalFromString(string $value): DateInterval
{
$negativeValPosition = strpos($value, '-');
$invert = 0;
Expand Down
8 changes: 4 additions & 4 deletions src/Serialization/SerializationWriterToStringTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
trait SerializationWriterToStringTrait
{
public function getDateIntervalValueAsString(DateInterval $value): string
private function getDateIntervalValueAsString(DateInterval $value): string
{
$year = $value->y > 0 ? "%yY" : "";
$month = $value->m > 0 ? "%mM" : "";
Expand All @@ -23,17 +23,17 @@ public function getDateIntervalValueAsString(DateInterval $value): string
$time = !empty($timePart) ? "T$timePart" : '';
return $value->format("%rP$year$month{$day}$time");
}
public function getDateTimeValueAsString(DateTime $value): string
private function getDateTimeValueAsString(DateTime $value): string
{
return $value->format(DateTimeInterface::RFC3339);
}

public function getBooleanValueAsString(bool $value): string
private function getBooleanValueAsString(bool $value): string
{
return $value ? 'true' : 'false';
}

public function getStringValueAsEscapedString(string $value): string
private function getStringValueAsEscapedString(string $value): string
{
return addcslashes($value, "\\\r\n\"\t");
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Serialization/ParseNodeTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function testDateIntervalValueFromStringNegative(): void
{
$parseNode = new class
{
use ParseNodeFromStringTrait;
use ParseNodeFromStringTrait {parseDateIntervalFromString as public;}
};
$value = $parseNode->parseDateIntervalFromString('-P1DT23H59M19S');
$dateInterval = new DateInterval('P1DT23H59M19S');
Expand All @@ -25,7 +25,7 @@ public function testDateIntervalValueFromString(): void
{
$parseNode = new class
{
use ParseNodeFromStringTrait;
use ParseNodeFromStringTrait {parseDateIntervalFromString as public;}
};
$value = $parseNode->parseDateIntervalFromString('P1DT23H59M19S');
$dateInterval = new DateInterval('P1DT23H59M19S');
Expand Down
8 changes: 4 additions & 4 deletions tests/Serialization/SerializationWriterToStringTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class SerializationWriterToStringTraitTest extends TestCase
public function testGetDateIntervalValueAsString(): void
{
$serializationWriter = new class {
use SerializationWriterToStringTrait;
use SerializationWriterToStringTrait {getDateIntervalValueAsString as public;}
};
$dateInterval = new DateInterval('P1D');
$dateInterval->invert = 1;
Expand All @@ -26,7 +26,7 @@ public function testGetDateIntervalValueAsString(): void
public function testGetDateTimeValueAsString(): void
{
$serializationWriter = new class {
use SerializationWriterToStringTrait;
use SerializationWriterToStringTrait {getDateTimeValueAsString as public;}
};
$dateTime = new DateTime('2024-04-29T15:12');
$dateTimeString = $serializationWriter->getDateTimeValueAsString($dateTime);
Expand All @@ -36,7 +36,7 @@ public function testGetDateTimeValueAsString(): void
public function testGetBooleanValueAsString(): void
{
$serializationWriter = new class {
use SerializationWriterToStringTrait;
use SerializationWriterToStringTrait {getBooleanValueAsString as public;}
};

$booleanValue = $serializationWriter->getBooleanValueAsString(true);
Expand All @@ -48,7 +48,7 @@ public function testGetBooleanValueAsString(): void
public function testGetEscapedValueAsEscapedString(): void
{
$serializationWriter = new class {
use SerializationWriterToStringTrait;
use SerializationWriterToStringTrait {getStringValueAsEscapedString as public;}
};
$originalString = 'Kenneth\n\Hello world';
$escapedString = $serializationWriter->getStringValueAsEscapedString($originalString);
Expand Down

0 comments on commit 951eb57

Please sign in to comment.