File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,22 @@ public function __construct(
88 public string $ name ,
99 public string $ displayName ,
1010 public string $ description ,
11- public int $ status ,
12- public bool $ isDefault ,
1311 public array $ options
1412 ) {}
13+
14+ public function __get (string $ name ): mixed
15+ {
16+ return match ($ name ) {
17+ 'status ' => $ this ->handleDeprecatedProperty ('status ' , 0 ),
18+ 'isDefault ' => $ this ->handleDeprecatedProperty ('isDefault ' , false ),
19+ default => throw new \InvalidArgumentException ("Property ' {$ name }' does not exist on Printer class " ),
20+ };
21+ }
22+
23+ private function handleDeprecatedProperty (string $ property , mixed $ defaultValue ): mixed
24+ {
25+ logger ()->warning ("Deprecated: Printer:: \${$ property } property has been removed in upstream Electron and will no longer be available " );
26+
27+ return $ defaultValue ;
28+ }
1529}
Original file line number Diff line number Diff line change @@ -55,8 +55,6 @@ public function printers(): array
5555 data_get ($ printer , 'name ' ),
5656 data_get ($ printer , 'displayName ' ),
5757 data_get ($ printer , 'description ' ),
58- data_get ($ printer , 'status ' ),
59- data_get ($ printer , 'isDefault ' ),
6058 data_get ($ printer , 'options ' ),
6159 );
6260 })->toArray ();
You can’t perform that action at this time.
0 commit comments