chillerlan-QRCode-Data-Number.html 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Documentation</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <base href="../">
  8. <link rel="icon" href="images/favicon.ico"/>
  9. <link rel="stylesheet" href="css/normalize.css">
  10. <link rel="stylesheet" href="css/base.css">
  11. <link rel="preconnect" href="https://fonts.gstatic.com">
  12. <link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
  13. <link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
  14. <link rel="stylesheet" href="css/template.css">
  15. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
  16. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
  17. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
  18. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
  19. <script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
  20. <script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
  21. <script src="js/template.js"></script>
  22. <script src="js/search.js"></script>
  23. <script defer src="js/searchIndex.js"></script>
  24. </head>
  25. <body id="top">
  26. <header class="phpdocumentor-header phpdocumentor-section">
  27. <h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">Documentation</a></h1>
  28. <input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
  29. <label class="phpdocumentor-header__menu-icon" for="menu-button">
  30. <i class="fas fa-bars"></i>
  31. </label>
  32. <section data-search-form class="phpdocumentor-search">
  33. <label>
  34. <span class="visually-hidden">Search for</span>
  35. <svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
  36. <circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
  37. <line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
  38. </svg>
  39. <input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
  40. </label>
  41. </section>
  42. <nav class="phpdocumentor-topnav">
  43. <ul class="phpdocumentor-topnav__menu">
  44. <li class="phpdocumentor-topnav__menu-item -menu">
  45. <a href="https://php-qrcode.readthedocs.io">
  46. <span>
  47. User Manual
  48. </span>
  49. </a>
  50. </li>
  51. <li class="phpdocumentor-topnav__menu-item -social">
  52. <a href="https://github.com/chillerlan/php-qrcode">
  53. <span>
  54. <i class="fab fa-github"></i>
  55. </span>
  56. </a>
  57. </li>
  58. <li class="phpdocumentor-topnav__menu-item -social">
  59. <a href="https://github.com/chillerlan/php-qrcode/discussions">
  60. <span>
  61. <i class="fas fa-envelope-open-text"></i>
  62. </span>
  63. </a>
  64. </li>
  65. </ul>
  66. </nav>
  67. </header>
  68. <main class="phpdocumentor">
  69. <div class="phpdocumentor-section">
  70. <input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
  71. <label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
  72. Menu
  73. </label>
  74. <aside class="phpdocumentor-column -three phpdocumentor-sidebar">
  75. <section class="phpdocumentor-sidebar__category -namespaces">
  76. <h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
  77. <h4 class="phpdocumentor-sidebar__root-namespace">
  78. <a href="namespaces/chillerlan.html" class="">chillerlan</a>
  79. </h4>
  80. <ul class="phpdocumentor-list">
  81. <li>
  82. <a href="namespaces/chillerlan-qrcode.html" class="">QRCode</a>
  83. </li>
  84. <li>
  85. <a href="namespaces/chillerlan-qrcodetest.html" class="">QRCodeTest</a>
  86. </li>
  87. </ul>
  88. </section>
  89. <section class="phpdocumentor-sidebar__category -packages">
  90. <h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
  91. <h4 class="phpdocumentor-sidebar__root-namespace">
  92. <a href="packages/Application.html" class="">Application</a>
  93. </h4>
  94. </section>
  95. <section class="phpdocumentor-sidebar__category -reports">
  96. <h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
  97. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
  98. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
  99. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
  100. </section>
  101. <section class="phpdocumentor-sidebar__category -indices">
  102. <h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
  103. <h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
  104. </section>
  105. </aside>
  106. <div class="phpdocumentor-column -nine phpdocumentor-content">
  107. <section>
  108. <ul class="phpdocumentor-breadcrumbs">
  109. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan.html">chillerlan</a></li>
  110. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode.html">QRCode</a></li>
  111. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode-data.html">Data</a></li>
  112. </ul>
  113. <article class="phpdocumentor-element -class">
  114. <h2 class="phpdocumentor-content__title">
  115. Number
  116. <span class="phpdocumentor-element__extends">
  117. extends <a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html"><abbr title="\chillerlan\QRCode\Data\QRDataModeAbstract">QRDataModeAbstract</abbr></a>
  118. </span>
  119. <div class="phpdocumentor-element__package">
  120. in package
  121. <ul class="phpdocumentor-breadcrumbs">
  122. <li class="phpdocumentor-breadcrumb"><a href="packages/Application.html">Application</a></li>
  123. </ul>
  124. </div>
  125. </h2>
  126. <div class="phpdocumentor-label-line">
  127. <div class="phpdocumentor-label phpdocumentor-label--success"><span>Final</span><span>Yes</span></div>
  128. </div>
  129. <aside class="phpdocumentor-element-found-in">
  130. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/Number.php"><a href="files/src-data-number.html"><abbr title="src/Data/Number.php">Number.php</abbr></a></abbr>
  131. :
  132. <span class="phpdocumentor-element-found-in__line">23</span>
  133. </aside>
  134. <p class="phpdocumentor-summary">Numeric mode: decimal digits 0 to 9</p>
  135. <section class="phpdocumentor-description"><p>ISO/IEC 18004:2000 Section 8.3.2
  136. ISO/IEC 18004:2000 Section 8.4.2</p>
  137. </section>
  138. <h3 id="toc">
  139. Table of Contents
  140. <a href="classes/chillerlan-QRCode-Data-Number.html#toc" class="headerlink"><i class="fas fa-link"></i></a>
  141. </h3>
  142. <h4 id="toc-constants">
  143. Constants
  144. <a href="classes/chillerlan-QRCode-Data-Number.html#toc-constants" class="headerlink"><i class="fas fa-link"></i></a>
  145. </h4>
  146. <dl class="phpdocumentor-table-of-contents">
  147. <dt class="phpdocumentor-table-of-contents__entry -constant -public">
  148. <a class="" href="classes/chillerlan-QRCode-Data-Number.html#constant_DATAMODE">DATAMODE</a>
  149. <span>
  150. &nbsp;= \chillerlan\QRCode\Common\Mode::NUMBER </span>
  151. </dt>
  152. </dl>
  153. <h4 id="toc-properties">
  154. Properties
  155. <a href="classes/chillerlan-QRCode-Data-Number.html#toc-properties" class="headerlink"><i class="fas fa-link"></i></a>
  156. </h4>
  157. <dl class="phpdocumentor-table-of-contents">
  158. <dt class="phpdocumentor-table-of-contents__entry -property -protected">
  159. <a class="" href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#property_data">$data</a>
  160. <span>
  161. &nbsp;: string </span>
  162. </dt>
  163. <dd>The data to write</dd>
  164. </dl>
  165. <h4 id="toc-methods">
  166. Methods
  167. <a href="classes/chillerlan-QRCode-Data-Number.html#toc-methods" class="headerlink"><i class="fas fa-link"></i></a>
  168. </h4>
  169. <dl class="phpdocumentor-table-of-contents">
  170. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  171. <a class="" href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method___construct">__construct()</a>
  172. <span>
  173. &nbsp;: mixed </span>
  174. </dt>
  175. <dd>QRDataModeAbstract constructor.</dd>
  176. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  177. <a class="" href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method_convertEncoding">convertEncoding()</a>
  178. <span>
  179. &nbsp;: string </span>
  180. </dt>
  181. <dd>encoding conversion helper</dd>
  182. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  183. <a class="" href="classes/chillerlan-QRCode-Data-Number.html#method_decodeSegment">decodeSegment()</a>
  184. <span>
  185. &nbsp;: string </span>
  186. </dt>
  187. <dd>reads a segment from the BitBuffer and decodes in the current data mode</dd>
  188. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  189. <a class="" href="classes/chillerlan-QRCode-Data-Number.html#method_getLengthInBits">getLengthInBits()</a>
  190. <span>
  191. &nbsp;: int </span>
  192. </dt>
  193. <dd>retruns the length in bits of the data string</dd>
  194. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  195. <a class="" href="classes/chillerlan-QRCode-Data-Number.html#method_validateString">validateString()</a>
  196. <span>
  197. &nbsp;: bool </span>
  198. </dt>
  199. <dd>checks if the given string qualifies for the encoder module</dd>
  200. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  201. <a class="" href="classes/chillerlan-QRCode-Data-Number.html#method_write">write()</a>
  202. <span>
  203. &nbsp;: static </span>
  204. </dt>
  205. <dd>writes the actual data string to the BitBuffer, uses the given version to determine the length bits</dd>
  206. <dt class="phpdocumentor-table-of-contents__entry -method -protected">
  207. <a class="" href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method_getCharCount">getCharCount()</a>
  208. <span>
  209. &nbsp;: int </span>
  210. </dt>
  211. <dd>returns the character count of the $data string</dd>
  212. <dt class="phpdocumentor-table-of-contents__entry -method -protected">
  213. <a class="" href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method_getLengthBits">getLengthBits()</a>
  214. <span>
  215. &nbsp;: int </span>
  216. </dt>
  217. <dd>shortcut</dd>
  218. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  219. <a class="" href="classes/chillerlan-QRCode-Data-Number.html#method_parseInt">parseInt()</a>
  220. <span>
  221. &nbsp;: int </span>
  222. </dt>
  223. <dd>get the code for the given numeric string</dd>
  224. </dl>
  225. <section class="phpdocumentor-constants">
  226. <h3 class="phpdocumentor-elements__header" id="constants">
  227. Constants
  228. <a href="classes/chillerlan-QRCode-Data-Number.html#constants" class="headerlink"><i class="fas fa-link"></i></a>
  229. </h3>
  230. <article class="phpdocumentor-element -constant -public ">
  231. <h4 class="phpdocumentor-element__name" id="constant_DATAMODE">
  232. DATAMODE
  233. <a href="classes/chillerlan-QRCode-Data-Number.html#constant_DATAMODE" class="headerlink"><i class="fas fa-link"></i></a>
  234. </h4>
  235. <aside class="phpdocumentor-element-found-in">
  236. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/Number.php"><a href="files/src-data-number.html"><abbr title="src/Data/Number.php">Number.php</abbr></a></abbr>
  237. :
  238. <span class="phpdocumentor-element-found-in__line">25</span>
  239. </aside>
  240. <code class="phpdocumentor-signature phpdocumentor-code ">
  241. <span class="phpdocumentor-signature__visibility">public</span>
  242. <span class="phpdocumentor-signature__type">mixed</span>
  243. <span class="phpdocumentor-signature__name">DATAMODE</span>
  244. = <span class="phpdocumentor-signature__default-value">\chillerlan\QRCode\Common\Mode::NUMBER</span>
  245. </code>
  246. </article>
  247. </section>
  248. <section class="phpdocumentor-properties">
  249. <h3 class="phpdocumentor-elements__header" id="properties">
  250. Properties
  251. <a href="classes/chillerlan-QRCode-Data-Number.html#properties" class="headerlink"><i class="fas fa-link"></i></a>
  252. </h3>
  253. <article
  254. class="
  255. phpdocumentor-element
  256. -property
  257. -protected
  258. "
  259. >
  260. <h4 class="phpdocumentor-element__name" id="property_data">
  261. $data
  262. <a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#property_data" class="headerlink"><i class="fas fa-link"></i></a>
  263. <span class="phpdocumentor-element__modifiers">
  264. </span>
  265. </h4>
  266. <aside class="phpdocumentor-element-found-in">
  267. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/QRDataModeAbstract.php"><a href="files/src-data-qrdatamodeabstract.html"><abbr title="src/Data/QRDataModeAbstract.php">QRDataModeAbstract.php</abbr></a></abbr>
  268. :
  269. <span class="phpdocumentor-element-found-in__line">24</span>
  270. </aside>
  271. <p class="phpdocumentor-summary">The data to write</p>
  272. <code class="phpdocumentor-code phpdocumentor-signature ">
  273. <span class="phpdocumentor-signature__visibility">protected</span>
  274. <span class="phpdocumentor-signature__type">string</span>
  275. <span class="phpdocumentor-signature__name">$data</span>
  276. </code>
  277. </article>
  278. </section>
  279. <section class="phpdocumentor-methods">
  280. <h3 class="phpdocumentor-elements__header" id="methods">
  281. Methods
  282. <a href="classes/chillerlan-QRCode-Data-Number.html#methods" class="headerlink"><i class="fas fa-link"></i></a>
  283. </h3>
  284. <article
  285. class="phpdocumentor-element
  286. -method
  287. -public
  288. "
  289. >
  290. <h4 class="phpdocumentor-element__name" id="method___construct">
  291. __construct()
  292. <a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method___construct" class="headerlink"><i class="fas fa-link"></i></a>
  293. </h4>
  294. <aside class="phpdocumentor-element-found-in">
  295. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/QRDataModeAbstract.php"><a href="files/src-data-qrdatamodeabstract.html"><abbr title="src/Data/QRDataModeAbstract.php">QRDataModeAbstract.php</abbr></a></abbr>
  296. :
  297. <span class="phpdocumentor-element-found-in__line">31</span>
  298. </aside>
  299. <p class="phpdocumentor-summary">QRDataModeAbstract constructor.</p>
  300. <code class="phpdocumentor-code phpdocumentor-signature ">
  301. <span class="phpdocumentor-signature__visibility">public</span>
  302. <span class="phpdocumentor-signature__name">__construct</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$data</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
  303. <div class="phpdocumentor-label-line">
  304. </div>
  305. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  306. <dl class="phpdocumentor-argument-list">
  307. <dt class="phpdocumentor-argument-list__entry">
  308. <span class="phpdocumentor-signature__argument__name">$data</span>
  309. : <span class="phpdocumentor-signature__argument__return-type">string</span>
  310. </dt>
  311. <dd class="phpdocumentor-argument-list__definition">
  312. </dd>
  313. </dl>
  314. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  315. Tags
  316. <a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method___construct#tags" class="headerlink"><i class="fas fa-link"></i></a>
  317. </h5>
  318. <dl class="phpdocumentor-tag-list">
  319. <dt class="phpdocumentor-tag-list__entry">
  320. <span class="phpdocumentor-tag__name">throws</span>
  321. </dt>
  322. <dd class="phpdocumentor-tag-list__definition">
  323. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-Data-QRCodeDataException.html"><abbr title="\chillerlan\QRCode\Data\QRCodeDataException">QRCodeDataException</abbr></a></span>
  324. </dd>
  325. </dl>
  326. </article>
  327. <article
  328. class="phpdocumentor-element
  329. -method
  330. -public
  331. -static "
  332. >
  333. <h4 class="phpdocumentor-element__name" id="method_convertEncoding">
  334. convertEncoding()
  335. <a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method_convertEncoding" class="headerlink"><i class="fas fa-link"></i></a>
  336. </h4>
  337. <aside class="phpdocumentor-element-found-in">
  338. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/QRDataModeAbstract.php"><a href="files/src-data-qrdatamodeabstract.html"><abbr title="src/Data/QRDataModeAbstract.php">QRDataModeAbstract.php</abbr></a></abbr>
  339. :
  340. <span class="phpdocumentor-element-found-in__line">48</span>
  341. </aside>
  342. <p class="phpdocumentor-summary">encoding conversion helper</p>
  343. <code class="phpdocumentor-code phpdocumentor-signature ">
  344. <span class="phpdocumentor-signature__visibility">public</span>
  345. <span class="phpdocumentor-signature__static">static</span> <span class="phpdocumentor-signature__name">convertEncoding</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$string</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
  346. <div class="phpdocumentor-label-line">
  347. </div>
  348. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  349. <dl class="phpdocumentor-argument-list">
  350. <dt class="phpdocumentor-argument-list__entry">
  351. <span class="phpdocumentor-signature__argument__name">$string</span>
  352. : <span class="phpdocumentor-signature__argument__return-type">string</span>
  353. </dt>
  354. <dd class="phpdocumentor-argument-list__definition">
  355. </dd>
  356. </dl>
  357. <section>
  358. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  359. <span class="phpdocumentor-signature__response_type">string</span>
  360. </section>
  361. </article>
  362. <article
  363. class="phpdocumentor-element
  364. -method
  365. -public
  366. -static "
  367. >
  368. <h4 class="phpdocumentor-element__name" id="method_decodeSegment">
  369. decodeSegment()
  370. <a href="classes/chillerlan-QRCode-Data-Number.html#method_decodeSegment" class="headerlink"><i class="fas fa-link"></i></a>
  371. </h4>
  372. <aside class="phpdocumentor-element-found-in">
  373. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/Number.php"><a href="files/src-data-number.html"><abbr title="src/Data/Number.php">Number.php</abbr></a></abbr>
  374. :
  375. <span class="phpdocumentor-element-found-in__line">93</span>
  376. </aside>
  377. <p class="phpdocumentor-summary">reads a segment from the BitBuffer and decodes in the current data mode</p>
  378. <code class="phpdocumentor-code phpdocumentor-signature ">
  379. <span class="phpdocumentor-signature__visibility">public</span>
  380. <span class="phpdocumentor-signature__static">static</span> <span class="phpdocumentor-signature__name">decodeSegment</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Common-BitBuffer.html"><abbr title="\chillerlan\QRCode\Common\BitBuffer">BitBuffer</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$bitBuffer</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$versionNumber</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
  381. <div class="phpdocumentor-label-line">
  382. </div>
  383. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  384. <dl class="phpdocumentor-argument-list">
  385. <dt class="phpdocumentor-argument-list__entry">
  386. <span class="phpdocumentor-signature__argument__name">$bitBuffer</span>
  387. : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Common-BitBuffer.html"><abbr title="\chillerlan\QRCode\Common\BitBuffer">BitBuffer</abbr></a></span>
  388. </dt>
  389. <dd class="phpdocumentor-argument-list__definition">
  390. </dd>
  391. <dt class="phpdocumentor-argument-list__entry">
  392. <span class="phpdocumentor-signature__argument__name">$versionNumber</span>
  393. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  394. </dt>
  395. <dd class="phpdocumentor-argument-list__definition">
  396. </dd>
  397. </dl>
  398. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  399. Tags
  400. <a href="classes/chillerlan-QRCode-Data-Number.html#method_decodeSegment#tags" class="headerlink"><i class="fas fa-link"></i></a>
  401. </h5>
  402. <dl class="phpdocumentor-tag-list">
  403. <dt class="phpdocumentor-tag-list__entry">
  404. <span class="phpdocumentor-tag__name">inheritDoc</span>
  405. </dt>
  406. <dd class="phpdocumentor-tag-list__definition">
  407. </dd>
  408. <dt class="phpdocumentor-tag-list__entry">
  409. <span class="phpdocumentor-tag__name">throws</span>
  410. </dt>
  411. <dd class="phpdocumentor-tag-list__definition">
  412. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-Data-QRCodeDataException.html"><abbr title="\chillerlan\QRCode\Data\QRCodeDataException">QRCodeDataException</abbr></a></span>
  413. </dd>
  414. </dl>
  415. <section>
  416. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  417. <span class="phpdocumentor-signature__response_type">string</span>
  418. </section>
  419. </article>
  420. <article
  421. class="phpdocumentor-element
  422. -method
  423. -public
  424. "
  425. >
  426. <h4 class="phpdocumentor-element__name" id="method_getLengthInBits">
  427. getLengthInBits()
  428. <a href="classes/chillerlan-QRCode-Data-Number.html#method_getLengthInBits" class="headerlink"><i class="fas fa-link"></i></a>
  429. </h4>
  430. <aside class="phpdocumentor-element-found-in">
  431. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/Number.php"><a href="files/src-data-number.html"><abbr title="src/Data/Number.php">Number.php</abbr></a></abbr>
  432. :
  433. <span class="phpdocumentor-element-found-in__line">27</span>
  434. </aside>
  435. <p class="phpdocumentor-summary">retruns the length in bits of the data string</p>
  436. <code class="phpdocumentor-code phpdocumentor-signature ">
  437. <span class="phpdocumentor-signature__visibility">public</span>
  438. <span class="phpdocumentor-signature__name">getLengthInBits</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  439. <div class="phpdocumentor-label-line">
  440. </div>
  441. <section>
  442. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  443. <span class="phpdocumentor-signature__response_type">int</span>
  444. </section>
  445. </article>
  446. <article
  447. class="phpdocumentor-element
  448. -method
  449. -public
  450. -static "
  451. >
  452. <h4 class="phpdocumentor-element__name" id="method_validateString">
  453. validateString()
  454. <a href="classes/chillerlan-QRCode-Data-Number.html#method_validateString" class="headerlink"><i class="fas fa-link"></i></a>
  455. </h4>
  456. <aside class="phpdocumentor-element-found-in">
  457. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/Number.php"><a href="files/src-data-number.html"><abbr title="src/Data/Number.php">Number.php</abbr></a></abbr>
  458. :
  459. <span class="phpdocumentor-element-found-in__line">31</span>
  460. </aside>
  461. <p class="phpdocumentor-summary">checks if the given string qualifies for the encoder module</p>
  462. <code class="phpdocumentor-code phpdocumentor-signature ">
  463. <span class="phpdocumentor-signature__visibility">public</span>
  464. <span class="phpdocumentor-signature__static">static</span> <span class="phpdocumentor-signature__name">validateString</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$string</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">bool</span></code>
  465. <div class="phpdocumentor-label-line">
  466. </div>
  467. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  468. <dl class="phpdocumentor-argument-list">
  469. <dt class="phpdocumentor-argument-list__entry">
  470. <span class="phpdocumentor-signature__argument__name">$string</span>
  471. : <span class="phpdocumentor-signature__argument__return-type">string</span>
  472. </dt>
  473. <dd class="phpdocumentor-argument-list__definition">
  474. </dd>
  475. </dl>
  476. <section>
  477. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  478. <span class="phpdocumentor-signature__response_type">bool</span>
  479. </section>
  480. </article>
  481. <article
  482. class="phpdocumentor-element
  483. -method
  484. -public
  485. "
  486. >
  487. <h4 class="phpdocumentor-element__name" id="method_write">
  488. write()
  489. <a href="classes/chillerlan-QRCode-Data-Number.html#method_write" class="headerlink"><i class="fas fa-link"></i></a>
  490. </h4>
  491. <aside class="phpdocumentor-element-found-in">
  492. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/Number.php"><a href="files/src-data-number.html"><abbr title="src/Data/Number.php">Number.php</abbr></a></abbr>
  493. :
  494. <span class="phpdocumentor-element-found-in__line">35</span>
  495. </aside>
  496. <p class="phpdocumentor-summary">writes the actual data string to the BitBuffer, uses the given version to determine the length bits</p>
  497. <code class="phpdocumentor-code phpdocumentor-signature ">
  498. <span class="phpdocumentor-signature__visibility">public</span>
  499. <span class="phpdocumentor-signature__name">write</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Common-BitBuffer.html"><abbr title="\chillerlan\QRCode\Common\BitBuffer">BitBuffer</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$bitBuffer</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$versionNumber</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">static</span></code>
  500. <div class="phpdocumentor-label-line">
  501. </div>
  502. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  503. <dl class="phpdocumentor-argument-list">
  504. <dt class="phpdocumentor-argument-list__entry">
  505. <span class="phpdocumentor-signature__argument__name">$bitBuffer</span>
  506. : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Common-BitBuffer.html"><abbr title="\chillerlan\QRCode\Common\BitBuffer">BitBuffer</abbr></a></span>
  507. </dt>
  508. <dd class="phpdocumentor-argument-list__definition">
  509. </dd>
  510. <dt class="phpdocumentor-argument-list__entry">
  511. <span class="phpdocumentor-signature__argument__name">$versionNumber</span>
  512. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  513. </dt>
  514. <dd class="phpdocumentor-argument-list__definition">
  515. </dd>
  516. </dl>
  517. <section>
  518. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  519. <span class="phpdocumentor-signature__response_type">static</span>
  520. </section>
  521. </article>
  522. <article
  523. class="phpdocumentor-element
  524. -method
  525. -protected
  526. "
  527. >
  528. <h4 class="phpdocumentor-element__name" id="method_getCharCount">
  529. getCharCount()
  530. <a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method_getCharCount" class="headerlink"><i class="fas fa-link"></i></a>
  531. </h4>
  532. <aside class="phpdocumentor-element-found-in">
  533. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/QRDataModeAbstract.php"><a href="files/src-data-qrdatamodeabstract.html"><abbr title="src/Data/QRDataModeAbstract.php">QRDataModeAbstract.php</abbr></a></abbr>
  534. :
  535. <span class="phpdocumentor-element-found-in__line">44</span>
  536. </aside>
  537. <p class="phpdocumentor-summary">returns the character count of the $data string</p>
  538. <code class="phpdocumentor-code phpdocumentor-signature ">
  539. <span class="phpdocumentor-signature__visibility">protected</span>
  540. <span class="phpdocumentor-signature__name">getCharCount</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  541. <div class="phpdocumentor-label-line">
  542. </div>
  543. <section>
  544. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  545. <span class="phpdocumentor-signature__response_type">int</span>
  546. </section>
  547. </article>
  548. <article
  549. class="phpdocumentor-element
  550. -method
  551. -protected
  552. -static "
  553. >
  554. <h4 class="phpdocumentor-element__name" id="method_getLengthBits">
  555. getLengthBits()
  556. <a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method_getLengthBits" class="headerlink"><i class="fas fa-link"></i></a>
  557. </h4>
  558. <aside class="phpdocumentor-element-found-in">
  559. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/QRDataModeAbstract.php"><a href="files/src-data-qrdatamodeabstract.html"><abbr title="src/Data/QRDataModeAbstract.php">QRDataModeAbstract.php</abbr></a></abbr>
  560. :
  561. <span class="phpdocumentor-element-found-in__line">55</span>
  562. </aside>
  563. <p class="phpdocumentor-summary">shortcut</p>
  564. <code class="phpdocumentor-code phpdocumentor-signature ">
  565. <span class="phpdocumentor-signature__visibility">protected</span>
  566. <span class="phpdocumentor-signature__static">static</span> <span class="phpdocumentor-signature__name">getLengthBits</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$versionNumber</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  567. <div class="phpdocumentor-label-line">
  568. </div>
  569. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  570. <dl class="phpdocumentor-argument-list">
  571. <dt class="phpdocumentor-argument-list__entry">
  572. <span class="phpdocumentor-signature__argument__name">$versionNumber</span>
  573. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  574. </dt>
  575. <dd class="phpdocumentor-argument-list__definition">
  576. </dd>
  577. </dl>
  578. <section>
  579. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  580. <span class="phpdocumentor-signature__response_type">int</span>
  581. </section>
  582. </article>
  583. <article
  584. class="phpdocumentor-element
  585. -method
  586. -private
  587. "
  588. >
  589. <h4 class="phpdocumentor-element__name" id="method_parseInt">
  590. parseInt()
  591. <a href="classes/chillerlan-QRCode-Data-Number.html#method_parseInt" class="headerlink"><i class="fas fa-link"></i></a>
  592. </h4>
  593. <aside class="phpdocumentor-element-found-in">
  594. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/Number.php"><a href="files/src-data-number.html"><abbr title="src/Data/Number.php">Number.php</abbr></a></abbr>
  595. :
  596. <span class="phpdocumentor-element-found-in__line">72</span>
  597. </aside>
  598. <p class="phpdocumentor-summary">get the code for the given numeric string</p>
  599. <code class="phpdocumentor-code phpdocumentor-signature ">
  600. <span class="phpdocumentor-signature__visibility">private</span>
  601. <span class="phpdocumentor-signature__name">parseInt</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$string</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  602. <div class="phpdocumentor-label-line">
  603. </div>
  604. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  605. <dl class="phpdocumentor-argument-list">
  606. <dt class="phpdocumentor-argument-list__entry">
  607. <span class="phpdocumentor-signature__argument__name">$string</span>
  608. : <span class="phpdocumentor-signature__argument__return-type">string</span>
  609. </dt>
  610. <dd class="phpdocumentor-argument-list__definition">
  611. </dd>
  612. </dl>
  613. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  614. Tags
  615. <a href="classes/chillerlan-QRCode-Data-Number.html#method_parseInt#tags" class="headerlink"><i class="fas fa-link"></i></a>
  616. </h5>
  617. <dl class="phpdocumentor-tag-list">
  618. <dt class="phpdocumentor-tag-list__entry">
  619. <span class="phpdocumentor-tag__name">throws</span>
  620. </dt>
  621. <dd class="phpdocumentor-tag-list__definition">
  622. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-Data-QRCodeDataException.html"><abbr title="\chillerlan\QRCode\Data\QRCodeDataException">QRCodeDataException</abbr></a></span>
  623. </dd>
  624. </dl>
  625. <section>
  626. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  627. <span class="phpdocumentor-signature__response_type">int</span>
  628. </section>
  629. </article>
  630. </section>
  631. <div class="phpdocumentor-modal" id="source-view">
  632. <div class="phpdocumentor-modal-bg" data-exit-button></div>
  633. <div class="phpdocumentor-modal-container">
  634. <div class="phpdocumentor-modal-content">
  635. <pre style="max-height: 500px; overflow-y: scroll" data-src="files/src/Data/Number.php.txt" class="language-php line-numbers linkable-line-numbers"></pre>
  636. </div>
  637. <button data-exit-button class="phpdocumentor-modal__close">&times;</button>
  638. </div>
  639. </div>
  640. <script type="text/javascript">
  641. (function () {
  642. function loadExternalCodeSnippet(el, url, line) {
  643. Array.prototype.slice.call(el.querySelectorAll('pre[data-src]')).forEach((pre) => {
  644. const src = url || pre.getAttribute('data-src').replace(/\\/g, '/');
  645. const language = 'php';
  646. const code = document.createElement('code');
  647. code.className = 'language-' + language;
  648. pre.textContent = '';
  649. pre.setAttribute('data-line', line)
  650. code.textContent = 'Loading…';
  651. pre.appendChild(code);
  652. var xhr = new XMLHttpRequest();
  653. xhr.open('GET', src, true);
  654. xhr.onreadystatechange = function () {
  655. if (xhr.readyState !== 4) {
  656. return;
  657. }
  658. if (xhr.status < 400 && xhr.responseText) {
  659. code.textContent = xhr.responseText;
  660. Prism.highlightElement(code);
  661. return;
  662. }
  663. if (xhr.status === 404) {
  664. code.textContent = '✖ Error: File could not be found';
  665. return;
  666. }
  667. if (xhr.status >= 400) {
  668. code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
  669. return;
  670. }
  671. code.textContent = '✖ Error: An unknown error occurred';
  672. };
  673. xhr.send(null);
  674. });
  675. }
  676. const modalButtons = document.querySelectorAll("[data-modal]");
  677. const openedAsLocalFile = window.location.protocol === 'file:';
  678. if (modalButtons.length > 0 && openedAsLocalFile) {
  679. console.warn(
  680. 'Viewing the source code is unavailable because you are opening this page from the file:// scheme; ' +
  681. 'browsers block XHR requests when a page is opened this way'
  682. );
  683. }
  684. modalButtons.forEach(function (trigger) {
  685. if (openedAsLocalFile) {
  686. trigger.setAttribute("hidden", "hidden");
  687. }
  688. trigger.addEventListener("click", function (event) {
  689. event.preventDefault();
  690. const modal = document.getElementById(trigger.dataset.modal);
  691. if (!modal) {
  692. console.error(`Modal with id "${trigger.dataset.modal}" could not be found`);
  693. return;
  694. }
  695. modal.classList.add("phpdocumentor-modal__open");
  696. loadExternalCodeSnippet(modal, trigger.dataset.src || null, trigger.dataset.line)
  697. const exits = modal.querySelectorAll("[data-exit-button]");
  698. exits.forEach(function (exit) {
  699. exit.addEventListener("click", function (event) {
  700. event.preventDefault();
  701. modal.classList.remove("phpdocumentor-modal__open");
  702. });
  703. });
  704. });
  705. });
  706. })();
  707. </script>
  708. </article>
  709. </section>
  710. <section class="phpdocumentor-on-this-page__sidebar">
  711. <section class="phpdocumentor-on-this-page__content">
  712. <strong class="phpdocumentor-on-this-page__title">On this page</strong>
  713. <ul class="phpdocumentor-list -clean">
  714. <li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
  715. <li>
  716. <ul class="phpdocumentor-list -clean">
  717. <li><a href="classes/chillerlan-QRCode-Data-Number.html#toc-constants">Constants</a></li>
  718. <li><a href="classes/chillerlan-QRCode-Data-Number.html#toc-properties">Properties</a></li>
  719. <li><a href="classes/chillerlan-QRCode-Data-Number.html#toc-methods">Methods</a></li>
  720. </ul>
  721. </li>
  722. <li class="phpdocumentor-on-this-page-section__title">Constants</li>
  723. <li>
  724. <ul class="phpdocumentor-list -clean">
  725. <li class=""><a href="classes/chillerlan-QRCode-Data-Number.html#constant_DATAMODE">DATAMODE</a></li>
  726. </ul>
  727. </li>
  728. <li class="phpdocumentor-on-this-page-section__title">Properties</li>
  729. <li>
  730. <ul class="phpdocumentor-list -clean">
  731. <li class=""><a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#property_data">$data</a></li>
  732. </ul>
  733. </li>
  734. <li class="phpdocumentor-on-this-page-section__title">Methods</li>
  735. <li>
  736. <ul class="phpdocumentor-list -clean">
  737. <li class=""><a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method___construct">__construct()</a></li>
  738. <li class=""><a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method_convertEncoding">convertEncoding()</a></li>
  739. <li class=""><a href="classes/chillerlan-QRCode-Data-Number.html#method_decodeSegment">decodeSegment()</a></li>
  740. <li class=""><a href="classes/chillerlan-QRCode-Data-Number.html#method_getLengthInBits">getLengthInBits()</a></li>
  741. <li class=""><a href="classes/chillerlan-QRCode-Data-Number.html#method_validateString">validateString()</a></li>
  742. <li class=""><a href="classes/chillerlan-QRCode-Data-Number.html#method_write">write()</a></li>
  743. <li class=""><a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method_getCharCount">getCharCount()</a></li>
  744. <li class=""><a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method_getLengthBits">getLengthBits()</a></li>
  745. <li class=""><a href="classes/chillerlan-QRCode-Data-Number.html#method_parseInt">parseInt()</a></li>
  746. </ul>
  747. </li>
  748. </ul>
  749. </section>
  750. </section>
  751. </div>
  752. <section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
  753. <section class="phpdocumentor-search-results__dialog">
  754. <header class="phpdocumentor-search-results__header">
  755. <h2 class="phpdocumentor-search-results__title">Search results</h2>
  756. <button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
  757. </header>
  758. <section class="phpdocumentor-search-results__body">
  759. <ul class="phpdocumentor-search-results__entries"></ul>
  760. </section>
  761. </section>
  762. </section>
  763. </div>
  764. <a href="classes/chillerlan-QRCode-Data-Number.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
  765. </main>
  766. <script>
  767. cssVars({});
  768. </script>
  769. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
  770. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
  771. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
  772. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
  773. </body>
  774. </html>