Skip to content

Commit

Permalink
fix: correct label positions doc block (#458)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartvanraaij authored Sep 13, 2023
1 parent 3ebba39 commit 318c6e3
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions src/Helper/MyParcelCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,11 @@ public function setLatestDataWithoutIds($key, $size = 300): self
/**
* Get link of labels
*
* @param int $positions The position of the label on an A4 sheet. Set to false to create an A6 sheet.
* You can specify multiple positions by using an array. E.g. [2,3,4]. If you do
* not specify an array, but specify a number, the following labels will fill the
* ascending positions. Positioning is only applied on the first page with labels.
* All subsequent pages will use the default positioning [1,2,3,4].
* @param mixed $positions The position(s) of the label(s) on an A4 sheet or false for an A6 sheet.
* Positioning is only applied on the first page with labels. All subsequent pages will use the default positioning `[1,2,3,4]`.
* Pass an array to specify the positions on an A4 sheet, e.g. `[2,3,4]`.
* Pass a number to specify the starting position on an A4 sheet, e.g. `2`. The following labels will fill the subsequent positions.
* Pass a falsy value to use an A6 sheet, e.g. `false` or `null`.
*
* @return self
* @throws \MyParcelNL\Sdk\src\Exception\AccountNotActiveException
Expand Down Expand Up @@ -439,11 +439,11 @@ public function setLinkOfLabels($positions = self::DEFAULT_A4_POSITION): self
* Receive label PDF
* After setPdfOfLabels() apiId and barcode is present
*
* @param int $positions The position of the label on an A4 sheet. You can specify multiple positions by
* using an array. E.g. [2,3,4]. If you do not specify an array, but specify a
* number, the following labels will fill the ascending positions. Positioning is
* only applied on the first page with labels. All subsequent pages will use the
* default positioning [1,2,3,4].
* @param mixed $positions The position(s) of the label(s) on an A4 sheet or false for an A6 sheet.
* Positioning is only applied on the first page with labels. All subsequent pages will use the default positioning `[1,2,3,4]`.
* Pass an array to specify the positions on an A4 sheet, e.g. `[2,3,4]`.
* Pass a number to specify the starting position on an A4 sheet, e.g. `2`. The following labels will fill the subsequent positions.
* Pass a falsy value to use an A6 sheet, e.g. `false` or `null`.
*
* @return self
* @throws \MyParcelNL\Sdk\src\Exception\AccountNotActiveException
Expand All @@ -452,7 +452,6 @@ public function setLinkOfLabels($positions = self::DEFAULT_A4_POSITION): self
*/
public function setPdfOfLabels($positions = self::DEFAULT_A4_POSITION): self
{
/** If $positions is not false, set paper size to A4 */
$this
->createConcepts()
->setLabelFormat($positions);
Expand Down Expand Up @@ -754,19 +753,19 @@ public function sortByCollection(MyParcelCollection $sortedCollection): self
}

/**
* Set label format settings The position of the label on an A4 sheet. You can specify multiple positions by
* using an array. E.g. [2,3,4]. If you do not specify an array, but specify a
* number, the following labels will fill the ascending positions. Positioning is
* only applied on the first page with labels. All subsequent pages will use the
* default positioning [1,2,3,4].
* Sets label format settings
*
* @param int|array|null $positions
* @param mixed $positions The position(s) of the label(s) on an A4 sheet or false for an A6 sheet.
* Positioning is only applied on the first page with labels. All subsequent pages will use the default positioning `[1,2,3,4]`.
* Pass an array to specify the positions on an A4 sheet, e.g. `[2,3,4]`.
* Pass a number to specify the starting position on an A4 sheet, e.g. `2`. The following labels will fill the subsequent positions.
* Pass a falsy value to use an A6 sheet, e.g. `false` or `null`.
*
* @return self
*/
private function setLabelFormat($positions): self
{
/** If $positions is not false, set paper size to A4 */
/** If $positions is not falsy, set paper size to A4 */
if (is_numeric($positions)) {
/** Generating positions for A4 paper */
$this->paper_size = 'A4';
Expand Down

0 comments on commit 318c6e3

Please sign in to comment.