Skip to content

Commit 0d703ff

Browse files
rawilkgithub-actions[bot]
authored andcommitted
PHP Linting (Pint)
1 parent a0493d0 commit 0d703ff

37 files changed

+89
-89
lines changed

src/Apis/AddressValidation/AddressValidation.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ class AddressValidation extends Api
2222

2323
protected int $requestOption = AddressValidationOption::ADDRESS_VALIDATION;
2424

25-
protected null|Address $address = null;
25+
protected ?Address $address = null;
2626

2727
protected static array $supportedCountries = ['US', 'PR'];
2828

29-
public function validate(Address $address = null): AddressValidationResponse
29+
public function validate(?Address $address = null): AddressValidationResponse
3030
{
3131
// The UPS Customer Integration Environment (sandbox = true) only allows certain states to be
3232
// validated, so we will always use the production api instead since it's free anyways.

src/Apis/Shipping/LabelRecovery.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ class LabelRecovery extends Api
1616
/** @var string */
1717
protected const ENDPOINT = '/LabelRecovery';
1818

19-
protected null|LabelSpecification $labelSpecification = null;
19+
protected ?LabelSpecification $labelSpecification = null;
2020

21-
protected null|Translate $translate = null;
21+
protected ?Translate $translate = null;
2222

23-
protected null|LabelDelivery $labelDelivery = null;
23+
protected ?LabelDelivery $labelDelivery = null;
2424

2525
protected string $trackingNumber = '';
2626

src/Apis/Shipping/ShipConfirm.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ class ShipConfirm extends Api
2323

2424
protected string $requestOption = ShipConfirmOptions::NON_VALIDATE;
2525

26-
protected null|Shipment $shipment = null;
26+
protected ?Shipment $shipment = null;
2727

28-
protected null|LabelSpecification $labelSpecification = null;
28+
protected ?LabelSpecification $labelSpecification = null;
2929

30-
protected null|ReceiptSpecification $receiptSpecification = null;
30+
protected ?ReceiptSpecification $receiptSpecification = null;
3131

3232
public function getDigest(): ShipConfirmResponse
3333
{

src/Apis/Shipping/VoidShipment.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ public function void(): VoidResponse
4242

4343
return VoidResponse::fromXml(
4444
$this
45-
->allowRequestErrors()
46-
->processRequest()
47-
->response()
45+
->allowRequestErrors()
46+
->processRequest()
47+
->response()
4848
);
4949
}
5050

src/Concerns/HasAttributes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ trait HasAttributes
2121
*/
2222
protected bool $castEmptyArraysAsTrue = true;
2323

24-
public function convertPropertyNamesToSnakeCase(array $data, string $parentKey = null): array
24+
public function convertPropertyNamesToSnakeCase(array $data, ?string $parentKey = null): array
2525
{
2626
$properties = [];
2727

src/Concerns/HasRelationships.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function relationResolver($class, $key)
3131
return null;
3232
}
3333

34-
protected function createRelationshipFromArray(string $relationship, array $data, string $parentKey = null)
34+
protected function createRelationshipFromArray(string $relationship, array $data, ?string $parentKey = null)
3535
{
3636
// If we have a non-associative array, we probably have an array of related entities.
3737
if (! $this->isAssociativeArray($data)) {

src/Entity/Activity/Activity.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* @property null|string $gmt_offset Format: (+/-) hh:mm
1818
* @property \Carbon\Carbon $date_time Parsed date and time object. Tries to use GMT date/time first, but falls back on date/time.
1919
* @property null|string $signed_for_by_name
20-
* If this activity is a delivery activity and there is a signature, it will be returned from the <ActivityLocation> Container.
20+
* If this activity is a delivery activity and there is a signature, it will be returned from the <ActivityLocation> Container.
2121
* @property null|\Rawilk\Ups\Entity\Activity\ActivityLocation $activity_location
2222
* @property null|\Rawilk\Ups\Entity\Tracking\Status $status Package activity status container.
2323
*/
@@ -57,7 +57,7 @@ public function isDelivered(): bool
5757
return $this->status->isDelivered();
5858
}
5959

60-
public function getSignedForByNameAttribute(): null|string
60+
public function getSignedForByNameAttribute(): ?string
6161
{
6262
return $this->activity_location->signed_for_by_name ?? null;
6363
}

src/Entity/AddressValidation/AddressValidationAddress.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* @property null|string $state
1616
* @property null|string $postal_code
1717
* @property null|string $postcode_extended_low
18-
* Low-end extended postal code in a range. Example in quotes: Postal Code 30076-'1234'. Only returned in candidate list. May be alphanumeric.
18+
* Low-end extended postal code in a range. Example in quotes: Postal Code 30076-'1234'. Only returned in candidate list. May be alphanumeric.
1919
* @property string $country_code
2020
* @property null|string $consignee_name Name of business, company or person. Not returned if user selects the RegionalRequestIndicator.
2121
* @property null|string $building_name Name of building. Not returned if user selects the RegionalRequestIndicator.

src/Entity/Entity.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
use Rawilk\Ups\Support\Xml;
1717
use SimpleXMLElement;
1818

19-
abstract class Entity implements ArrayAccess, Arrayable, Jsonable, JsonSerializable, Xmlable
19+
abstract class Entity implements Arrayable, ArrayAccess, Jsonable, JsonSerializable, Xmlable
2020
{
2121
use EntityHasAttributes;
22-
use HasRelationships;
2322
use HasAttributes {
2423
setAttribute as hasAttributesSetAttribute;
2524
getAttribute as hasAttributesGetAttribute;
2625
}
26+
use HasRelationships;
2727

2828
public $exists = false;
2929

@@ -144,7 +144,7 @@ public function toJson($options = 0): string
144144
{
145145
$json = json_encode($this->jsonSerialize(), $options);
146146

147-
if (JSON_ERROR_NONE !== json_last_error()) {
147+
if (json_last_error() !== JSON_ERROR_NONE) {
148148
throw new JsonEncodingException(
149149
'Error encoding UPS entity [' . get_class($this) . '] to JSON: ' . json_last_error_msg()
150150
);

src/Entity/Payment/BillShipper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
/**
1010
* @property null|string $account_number
11-
* UPS account number. Must be the same account number as the one provided in Shipment/Shipper/ShipperNumber attribute.
11+
* UPS account number. Must be the same account number as the one provided in Shipment/Shipper/ShipperNumber attribute.
1212
* @property null|\Rawilk\Ups\Entity\Payment\CreditCard $credit_card
1313
*/
1414
class BillShipper extends Entity

src/Entity/Payment/BillThirdPartyConsignee.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
/**
1010
* @property string $account_number
11-
* The UPS account number of the third party consignee.
11+
* The UPS account number of the third party consignee.
1212
* @property \Rawilk\Ups\Entity\Payment\ThirdParty $third_party
1313
*/
1414
class BillThirdPartyConsignee extends Entity

src/Entity/Payment/BillThirdPartyShipper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
/**
1010
* @property string $account_number
11-
* The account number of the third party shipper.
11+
* The account number of the third party shipper.
1212
* @property \Rawilk\Ups\Entity\Payment\ThirdParty $third_party
1313
*/
1414
class BillThirdPartyShipper extends Entity

src/Entity/Payment/ItemizedPaymentInformation.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
/**
1010
* @property \Rawilk\Ups\Entity\Payment\ShipmentCharge[] $shipment_charges
1111
* @property bool $split_duty_vat
12-
* The presence indicates the payer specified for Transportation Charges will pay
13-
* transportation charges and any duties that apply to the shipment.
12+
* The presence indicates the payer specified for Transportation Charges will pay
13+
* transportation charges and any duties that apply to the shipment.
1414
*/
1515
class ItemizedPaymentInformation extends Entity
1616
{

src/Entity/Payment/RateInformation.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88

99
/**
1010
* @property bool $negotiated_rates
11-
* If true and the shipper is authorized, then Negotiated Rates should be returned in the response.
11+
* If true and the shipper is authorized, then Negotiated Rates should be returned in the response.
1212
* @property bool $rate_chart
13-
* If true, the response will contain a RateChart Element.
13+
* If true, the response will contain a RateChart Element.
1414
* @property bool $user_level_discount
15-
* If true, user level discount will be applied to rates if applicable.
15+
* If true, user level discount will be applied to rates if applicable.
1616
*/
1717
class RateInformation extends Entity
1818
{

src/Entity/Payment/ShipmentCharge.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* @property null|\Rawilk\Ups\Entity\Payment\BillReceiver $bill_receiver
1313
* @property null|\Rawilk\Ups\Entity\Payment\BillThirdParty $bill_third_party
1414
* @property bool $consignee_billed
15-
* Valid for shipment charge type of transportation only.
15+
* Valid for shipment charge type of transportation only.
1616
*/
1717
class ShipmentCharge extends Entity
1818
{

src/Entity/Shipment/Label/LabelImage.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
* @property \Rawilk\Ups\Entity\Shipment\Label\LabelImageFormat $label_image_format
1111
* @property string $graphic_image Base 64 encoded graphic image
1212
* @property string $html_image
13-
* Base 64 encoded html browser image rendering software. This is only returned for GIF image formats.
13+
* Base 64 encoded html browser image rendering software. This is only returned for GIF image formats.
1414
* @property string $url
15-
* This is only returned if the label link is requested to be returned and only at the first package
16-
* result.
15+
* This is only returned if the label link is requested to be returned and only at the first package
16+
* result.
1717
*/
1818
class LabelImage extends Entity
1919
{

src/Entity/Shipment/Label/LabelResult.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
/**
1111
* @property null|string $tracking_number
12-
* Package Tracking number. Package 1Z number. Returned only if TrackingNumber or Combination of Reference Number
13-
* and Shipper Number is present in request.
12+
* Package Tracking number. Package 1Z number. Returned only if TrackingNumber or Combination of Reference Number
13+
* and Shipper Number is present in request.
1414
* @property \Rawilk\Ups\Entity\Shipment\Label\LabelImage $label_image
1515
* @property null|\Rawilk\Ups\Entity\Shipment\Receipt\Receipt $receipt
1616
*/

src/Entity/Shipment/Label/LabelSpecification.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88

99
/**
1010
* @property null|string $http_user_agent
11-
* Browser HTTPUserAgent String. This is the preferred way of identifying GIF image type to be generated.
11+
* Browser HTTPUserAgent String. This is the preferred way of identifying GIF image type to be generated.
1212
* @property null|string $character_set
1313
* @property \Rawilk\Ups\Entity\Shipment\Label\LabelPrintMethod $label_print_method
1414
* @property null|\Rawilk\Ups\Entity\Shipment\Label\LabelStockSize $label_stock_size
15-
* For EPL2, ZPL, STARPL, and SPL labels.
15+
* For EPL2, ZPL, STARPL, and SPL labels.
1616
* @property \Rawilk\Ups\Entity\Shipment\Label\LabelImageFormat $label_image_format
1717
* @property null|\Rawilk\Ups\Entity\Shipment\Label\Instruction $instruction
1818
*/

src/Entity/Shipment/Package.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
/**
1414
* @property bool $additional_handling Additional handling required.
1515
* @property null|string $description
16-
* Merchandise description of package. Required for shipment with return service.
16+
* Merchandise description of package. Required for shipment with return service.
1717
* @property null|string $pallet_description
18-
* Description of articles & special marks. Applicable for Air Freight only.
18+
* Description of articles & special marks. Applicable for Air Freight only.
1919
* @property bool $is_large
2020
* @property string $tracking_number
2121
* @property bool $ups_premium_care_indicator
@@ -29,7 +29,7 @@
2929
* @property \Rawilk\Ups\Entity\Shipment\ReferenceNumber $reference_number
3030
* @property \Rawilk\Ups\Entity\Shipment\ReferenceNumber $reference_number2
3131
* @property null|\Rawilk\Ups\Entity\Tracking\EstimatedDeliveryWindow $estimated_delivery_window
32-
* Only applies to tracking api responses.
32+
* Only applies to tracking api responses.
3333
*/
3434
class Package extends Entity
3535
{
@@ -152,7 +152,7 @@ public function isPickedUp(): bool
152152
* Returns the name of the person who signed for the package if
153153
* it has been delivered when using the tracking api.
154154
*/
155-
public function signedForByName(): null|string
155+
public function signedForByName(): ?string
156156
{
157157
if (! $this->isDelivered()) {
158158
return null;

src/Entity/Shipment/PackageResult.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function labelImage(): string
2222
return LabelImage::class;
2323
}
2424

25-
public function getDecodedImageContent(): null|string
25+
public function getDecodedImageContent(): ?string
2626
{
2727
if (! $this->label_image->graphic_image) {
2828
return null;

src/Entity/Shipment/PackageServiceOptions/HazMat.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99

1010
/**
1111
* @property int $packaging_type_quantity
12-
* The number of pieces of the specific commodity.
12+
* The number of pieces of the specific commodity.
1313
* @property string $sub_risk_class
1414
* @property string $adr_item_number
15-
* The type of regulated goods for an ADR package where ADR is for Europe to Europe ground movement.
15+
* The type of regulated goods for an ADR package where ADR is for Europe to Europe ground movement.
1616
* @property string $adr_packaging_group_letter
1717
* @property string $technical_name
1818
* @property string $hazard_label_required
19-
* Defines the type of label that is required on the package for the commodity.
19+
* Defines the type of label that is required on the package for the commodity.
2020
* @property string $class_division_number
2121
* @property string $reference_number
2222
* @property string $quantity

src/Entity/Shipment/PackageServiceOptions/PackageServiceOptions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* @property null|\Rawilk\Ups\Entity\Shipment\ShipmentServiceOptions\COD $cod
1818
* @property null|\Rawilk\Ups\Entity\Shipment\ShipmentServiceOptions\AccessPointCOD $access_point_cod
1919
* @property null|\Rawilk\Ups\Entity\Shipment\PackageServiceOptions\HazMat|\Rawilk\Ups\Entity\Shipment\PackageServiceOptions\HazMat[] $haz_mat
20-
* Max of 3 allowed.
20+
* Max of 3 allowed.
2121
* @property null|\Rawilk\Ups\Entity\Shipment\PackageServiceOptions\HazMatPackageInformation $haz_mat_package_information
2222
*/
2323
class PackageServiceOptions extends Entity

src/Entity/Shipment/ReferenceNumber.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
/**
1010
* @property bool $barcode
1111
* @property string $code
12-
* Reference Number type code. For the entire shipment, the code specifies the reference name.
12+
* Reference Number type code. For the entire shipment, the code specifies the reference name.
1313
* @property string $value
14-
* The customer supplied reference number.
14+
* The customer supplied reference number.
1515
*/
1616
class ReferenceNumber extends Entity
1717
{

src/Entity/Shipment/ShipFrom.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
* @property string $company_name Origin location's company name.
1212
* @property null|string $attention_name Contact name at the pickup location.
1313
* @property null|string $tax_identification_number
14-
* Company's tax identification number at the pickup location.
14+
* Company's tax identification number at the pickup location.
1515
* @property null|\Rawilk\Ups\Entity\Shipment\TaxIDType $tax_id_type
16-
* Applies to EEI form only.
16+
* Applies to EEI form only.
1717
* @property null|string $phone_number Origin location's phone number.
1818
* @property null|string $fax_number Origin location's fax number.
1919
* @property \Rawilk\Ups\Entity\Address\Address $address Address of the pickup location.

src/Entity/Shipment/ShipTo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
/**
1111
* @property null|string $location_id
12-
* LocationID is a unique identifier referring to a specific shipping/receiving location.
12+
* LocationID is a unique identifier referring to a specific shipping/receiving location.
1313
* @property string $receiving_address_name
1414
* @property string $bookmark
1515
* @property string $shipper_assigned_identification_number

src/Entity/Shipment/Shipment.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,26 @@
1717

1818
/**
1919
* @property null|string $description
20-
* The description of Goods for the shipment. Applies to international and domestic shipments.
20+
* The description of Goods for the shipment. Applies to international and domestic shipments.
2121
* @property bool $documents_only
22-
* Indicates a shipment contains written typed, or printed communication of no commercial value.
22+
* Indicates a shipment contains written typed, or printed communication of no commercial value.
2323
* @property bool $goods_not_in_free_circulation
2424
* @property null|int $num_of_pieces_in_shipment
25-
* Total number of pieces in all pallets in a UPS World Wide Express Freight Shipment.
25+
* Total number of pieces in all pallets in a UPS World Wide Express Freight Shipment.
2626
* @property bool $rating_method_requested
27-
* If true, Billable Weight Collection information and Rating Method information would be returned
28-
* in response.
27+
* If true, Billable Weight Collection information and Rating Method information would be returned
28+
* in response.
2929
* @property bool $tax_information
30-
* If true, any taxes that may be applicable to a shipment would be returned in a response.
30+
* If true, any taxes that may be applicable to a shipment would be returned in a response.
3131
* @property bool $master_carton
3232
* @property null|string $master_carton_id
3333
* @property null|\Rawilk\Ups\Entity\Shipment\ReturnService $return_service
34-
* Type of return service. When this entity is present, the shipment is a return shipment.
34+
* Type of return service. When this entity is present, the shipment is a return shipment.
3535
* @property \Rawilk\Ups\Entity\Shipment\Shipper $shipper
36-
* Container for the shipper's information.
36+
* Container for the shipper's information.
3737
* @property \Rawilk\Ups\Entity\Shipment\ShipTo $ship_to
3838
* @property \Rawilk\Ups\Entity\Shipment\ShipFrom $ship_from
39-
* Required for return shipment or if pickup location is different than the shipper's address.
39+
* Required for return shipment or if pickup location is different than the shipper's address.
4040
* @property null|\Rawilk\Ups\Entity\Shipment\SoldTo $sold_to
4141
* @property null|\Rawilk\Ups\Entity\Payment\PaymentInformation $payment_information
4242
* @property null|\Rawilk\Ups\Entity\Payment\ItemizedPaymentInformation $itemized_payment_information
@@ -48,9 +48,9 @@
4848
* @property \Illuminate\Support\Collection|\Rawilk\Ups\Entity\Shipment\Package[] $packages
4949
* @property null|\Rawilk\Ups\Entity\Shipment\ShipmentIndicationType $shipment_indication_type
5050
* @property null|\Rawilk\Ups\Entity\Shipment\ReferenceNumber $reference_number
51-
* Shipment reference number. Applies to tracking api responses.
51+
* Shipment reference number. Applies to tracking api responses.
5252
* @property null|\Carbon\Carbon $pickup_date
53-
* Date shipment was picked up. Only applies to tracking api responses. Format: YYYYMMDD.
53+
* Date shipment was picked up. Only applies to tracking api responses. Format: YYYYMMDD.
5454
* @property null|string $shipment_identification_number Only applies to tracking api responses.
5555
*/
5656
class Shipment extends Entity

src/Entity/Shipment/ShipmentServiceOptions/COD.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
* @property string $cod_code
1515
* @property string $cod_funds_code
16-
* For valid values refer to: Rating and Shipping COD Supported Countries or Territories in the UPS developer docs Appendix.
16+
* For valid values refer to: Rating and Shipping COD Supported Countries or Territories in the UPS developer docs Appendix.
1717
* @property \Rawilk\Ups\Entity\Shipment\ShipmentServiceOptions\CODAmount $cod_amount
1818
*/
1919
class COD extends Entity

0 commit comments

Comments
 (0)