Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifying convertEmptyStringToNull function to pass variables by reference #221

Open
wants to merge 1 commit into
base: 2.0.0-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Parser/Property/AddressParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ private function parseAddress(string $value): Address
$countryName
) = explode(';', $value);

$this->convertEmptyStringToNull([
$this->convertEmptyStringToNull(
$postOfficeBox,
$extendedAddress,
$streetAddress,
$locality,
$region,
$postalCode,
$countryName
]);
);

return new Address($postOfficeBox, $extendedAddress, $streetAddress, $locality, $region, $postalCode, $countryName);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Parser/Property/GenderParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function parseVcfString(string $value, array $parameters = []): NodeInter
{
@list($gender, $note) = explode(';', $value, 2);

$this->convertEmptyStringToNull([$note]);
$this->convertEmptyStringToNull($note);

return new Gender($gender, $note);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Parser/Property/NameParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ public function parseVcfString(string $value, array $parameters = []): NodeInter
{
@list($firstName, $additional, $lastName, $prefix, $suffix) = explode(';', $value);

$this->convertEmptyStringToNull([
$this->convertEmptyStringToNull(
$lastName,
$firstName,
$additional,
$prefix,
$suffix
]);
);

return new Name($lastName, $firstName, $additional, $prefix, $suffix);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Parser/Property/PropertyParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class PropertyParser
{
protected function convertEmptyStringToNull(array $values): void
protected function convertEmptyStringToNull(&...$values): void
{
foreach ($values as &$value) {
if ($value === '') {
Expand Down