-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #264 from sprain/tafel-scissors-master
Add possibility to show scissors and more display options
- Loading branch information
Showing
283 changed files
with
21,055 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Sprain\SwissQrBill\PaymentPart\Output; | ||
|
||
final class DisplayOptions | ||
{ | ||
private bool $isPrintable = false; | ||
private bool $displayScissors = false; | ||
private bool $positionScissorsAtBottom = false; | ||
private bool $displayTextDownArrows = false; | ||
private bool $displayText = true; | ||
private string $lineStyle = LineStyle::SOLID; | ||
|
||
public function isPrintable(): bool | ||
{ | ||
return $this->isPrintable; | ||
} | ||
|
||
public function setPrintable(bool $isPrintable): self | ||
{ | ||
$this->isPrintable = $isPrintable; | ||
|
||
return $this; | ||
} | ||
|
||
public function isDisplayScissors(): bool | ||
{ | ||
return $this->displayScissors; | ||
} | ||
|
||
public function setDisplayScissors(bool $displayScissors): self | ||
{ | ||
$this->displayScissors = $displayScissors; | ||
|
||
return $this; | ||
} | ||
|
||
public function isPositionScissorsAtBottom(): bool | ||
{ | ||
return $this->positionScissorsAtBottom; | ||
} | ||
|
||
public function setPositionScissorsAtBottom(bool $positionScissorsAtBottom): self | ||
{ | ||
$this->positionScissorsAtBottom = $positionScissorsAtBottom; | ||
|
||
return $this; | ||
} | ||
|
||
public function isDisplayTextDownArrows(): bool | ||
{ | ||
return $this->displayTextDownArrows; | ||
} | ||
|
||
public function setDisplayTextDownArrows(bool $displayTextDownArrows): self | ||
{ | ||
$this->displayTextDownArrows = $displayTextDownArrows; | ||
|
||
return $this; | ||
} | ||
|
||
public function isDisplayText(): bool | ||
{ | ||
return $this->displayText; | ||
} | ||
|
||
public function getLineStyle(): string | ||
{ | ||
return $this->lineStyle; | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
public function consolidate(): void | ||
{ | ||
$this->lineStyle = $this->displayScissors ? LineStyle::DASHED : LineStyle::SOLID; | ||
|
||
if ($this->isPrintable) { | ||
$this->lineStyle = LineStyle::NONE; | ||
} | ||
|
||
if ($this->displayScissors) { | ||
$this->displayText = false; | ||
$this->displayTextDownArrows = false; | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
final class LineStyle | ||
{ | ||
public const SOLID = 'SOLID'; | ||
public const DASHED = 'DASHED'; | ||
public const NONE = 'NONE'; | ||
} |
Oops, something went wrong.