File tree Expand file tree Collapse file tree 7 files changed +113
-11
lines changed Expand file tree Collapse file tree 7 files changed +113
-11
lines changed Original file line number Diff line number Diff line change @@ -45,13 +45,6 @@ abstract class Zend_Pdf_Element
4545 */
4646 private $ _parentObject = null ;
4747
48- /**
49- * Object value
50- *
51- * @var string
52- */
53- public $ value ;
54-
5548 /**
5649 * Return type of the element.
5750 * See ZPdfPDFConst for possible values
@@ -138,10 +131,7 @@ public function cleanUp()
138131 *
139132 * @return mixed
140133 */
141- public function toPhp ()
142- {
143- return $ this ->value ;
144- }
134+ abstract public function toPhp ();
145135
146136 /**
147137 * Convert PHP value into PDF element.
Original file line number Diff line number Diff line change 3434 */
3535class Zend_Pdf_Element_Boolean extends Zend_Pdf_Element
3636{
37+ /**
38+ * Object value
39+ *
40+ * @var boolean
41+ */
42+ public $ value ;
43+
44+
3745 /**
3846 * Object constructor
3947 *
@@ -72,4 +80,15 @@ public function toString($factory = null)
7280 {
7381 return $ this ->value ? 'true ' : 'false ' ;
7482 }
83+
84+
85+ /**
86+ * Convert PDF element to PHP type.
87+ *
88+ * @return boolean
89+ */
90+ public function toPhp ()
91+ {
92+ return $ this ->value ;
93+ }
7594}
Original file line number Diff line number Diff line change 3434 */
3535class Zend_Pdf_Element_Name extends Zend_Pdf_Element
3636{
37+ /**
38+ * Object value
39+ *
40+ * @var string
41+ */
42+ public $ value ;
43+
44+
3745 /**
3846 * Object constructor
3947 *
@@ -150,4 +158,15 @@ public function toString($factory = null)
150158 {
151159 return '/ ' . self ::escape ((string )$ this ->value );
152160 }
161+
162+
163+ /**
164+ * Convert PDF element to PHP type.
165+ *
166+ * @return string
167+ */
168+ public function toPhp ()
169+ {
170+ return $ this ->value ;
171+ }
153172}
Original file line number Diff line number Diff line change 3434 */
3535class Zend_Pdf_Element_Null extends Zend_Pdf_Element
3636{
37+ /**
38+ * Object value. Always null.
39+ *
40+ * @var mixed
41+ */
42+ public $ value ;
43+
44+
3745 /**
3846 * Object constructor
3947 */
@@ -64,4 +72,15 @@ public function toString($factory = null)
6472 {
6573 return 'null ' ;
6674 }
75+
76+
77+ /**
78+ * Convert PDF element to PHP type.
79+ *
80+ * @return mixed
81+ */
82+ public function toPhp ()
83+ {
84+ return $ this ->value ;
85+ }
6786}
Original file line number Diff line number Diff line change 3434 */
3535class Zend_Pdf_Element_Numeric extends Zend_Pdf_Element
3636{
37+ /**
38+ * Object value
39+ *
40+ * @var numeric
41+ */
42+ public $ value ;
43+
44+
3745 /**
3846 * Object constructor
3947 *
@@ -84,4 +92,15 @@ public function toString($factory = null)
8492 }
8593 return sprintf ("%. {$ prec }F " , $ this ->value );
8694 }
95+
96+
97+ /**
98+ * Convert PDF element to PHP type.
99+ *
100+ * @return numeric
101+ */
102+ public function toPhp ()
103+ {
104+ return $ this ->value ;
105+ }
87106}
Original file line number Diff line number Diff line change 3737 */
3838class Zend_Pdf_Element_Stream extends Zend_Pdf_Element
3939{
40+ /**
41+ * Object value
42+ *
43+ * @var Zend_Memory_Container
44+ */
45+ public $ value ;
46+
47+
4048 /**
4149 * Object constructor
4250 *
@@ -119,4 +127,14 @@ public function toString($factory = null)
119127 {
120128 return "stream \n" . $ this ->value ->getRef () . "\nendstream " ;
121129 }
130+
131+ /**
132+ * Convert PDF element to PHP type.
133+ *
134+ * @return Zend_Memory_Container
135+ */
136+ public function toPhp ()
137+ {
138+ return $ this ->value ;
139+ }
122140}
Original file line number Diff line number Diff line change 3333 */
3434class Zend_Pdf_Element_String extends Zend_Pdf_Element
3535{
36+ /**
37+ * Object value
38+ *
39+ * @var string
40+ */
41+ public $ value ;
42+
3643 /**
3744 * Object constructor
3845 *
@@ -67,6 +74,17 @@ public function toString($factory = null)
6774 }
6875
6976
77+ /**
78+ * Convert PDF element to PHP type.
79+ *
80+ * @return string
81+ */
82+ public function toPhp ()
83+ {
84+ return $ this ->value ;
85+ }
86+
87+
7088 /**
7189 * Escape string according to the PDF rules
7290 *
You can’t perform that action at this time.
0 commit comments