chillerlan-QRCode-Data-Number.html 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032
  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. = <span class="phpdocumentor-signature__default-value">&#039;&#039;</span></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>[</span><span class="phpdocumentor-signature__argument__return-type">string|null&nbsp;</span><span class="phpdocumentor-signature__argument__name">$data</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">null</span><span> ]</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|null</span>
  310. = <span class="phpdocumentor-signature__argument__default-value">null</span> </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">52</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. "
  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__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">48</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. "
  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">59</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__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. d=document.getElementsByClassName("line-numbers");
  662. d[0].scrollTop = d[0].children[1].offsetTop;
  663. return;
  664. }
  665. if (xhr.status === 404) {
  666. code.textContent = '✖ Error: File could not be found';
  667. return;
  668. }
  669. if (xhr.status >= 400) {
  670. code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
  671. return;
  672. }
  673. code.textContent = '✖ Error: An unknown error occurred';
  674. };
  675. xhr.send(null);
  676. });
  677. }
  678. const modalButtons = document.querySelectorAll("[data-modal]");
  679. const openedAsLocalFile = window.location.protocol === 'file:';
  680. if (modalButtons.length > 0 && openedAsLocalFile) {
  681. console.warn(
  682. 'Viewing the source code is unavailable because you are opening this page from the file:// scheme; ' +
  683. 'browsers block XHR requests when a page is opened this way'
  684. );
  685. }
  686. modalButtons.forEach(function (trigger) {
  687. if (openedAsLocalFile) {
  688. trigger.setAttribute("hidden", "hidden");
  689. }
  690. trigger.addEventListener("click", function (event) {
  691. event.preventDefault();
  692. const modal = document.getElementById(trigger.dataset.modal);
  693. if (!modal) {
  694. console.error(`Modal with id "${trigger.dataset.modal}" could not be found`);
  695. return;
  696. }
  697. modal.classList.add("phpdocumentor-modal__open");
  698. loadExternalCodeSnippet(modal, trigger.dataset.src || null, trigger.dataset.line)
  699. const exits = modal.querySelectorAll("[data-exit-button]");
  700. exits.forEach(function (exit) {
  701. exit.addEventListener("click", function (event) {
  702. event.preventDefault();
  703. modal.classList.remove("phpdocumentor-modal__open");
  704. });
  705. });
  706. });
  707. });
  708. })();
  709. </script>
  710. </article>
  711. </section>
  712. <section class="phpdocumentor-on-this-page__sidebar">
  713. <section class="phpdocumentor-on-this-page__content">
  714. <strong class="phpdocumentor-on-this-page__title">On this page</strong>
  715. <ul class="phpdocumentor-list -clean">
  716. <li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
  717. <li>
  718. <ul class="phpdocumentor-list -clean">
  719. <li><a href="classes/chillerlan-QRCode-Data-Number.html#toc-constants">Constants</a></li>
  720. <li><a href="classes/chillerlan-QRCode-Data-Number.html#toc-properties">Properties</a></li>
  721. <li><a href="classes/chillerlan-QRCode-Data-Number.html#toc-methods">Methods</a></li>
  722. </ul>
  723. </li>
  724. <li class="phpdocumentor-on-this-page-section__title">Constants</li>
  725. <li>
  726. <ul class="phpdocumentor-list -clean">
  727. <li class=""><a href="classes/chillerlan-QRCode-Data-Number.html#constant_DATAMODE">DATAMODE</a></li>
  728. </ul>
  729. </li>
  730. <li class="phpdocumentor-on-this-page-section__title">Properties</li>
  731. <li>
  732. <ul class="phpdocumentor-list -clean">
  733. <li class=""><a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#property_data">$data</a></li>
  734. </ul>
  735. </li>
  736. <li class="phpdocumentor-on-this-page-section__title">Methods</li>
  737. <li>
  738. <ul class="phpdocumentor-list -clean">
  739. <li class=""><a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method___construct">__construct()</a></li>
  740. <li class=""><a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method_convertEncoding">convertEncoding()</a></li>
  741. <li class=""><a href="classes/chillerlan-QRCode-Data-Number.html#method_decodeSegment">decodeSegment()</a></li>
  742. <li class=""><a href="classes/chillerlan-QRCode-Data-Number.html#method_getLengthInBits">getLengthInBits()</a></li>
  743. <li class=""><a href="classes/chillerlan-QRCode-Data-Number.html#method_validateString">validateString()</a></li>
  744. <li class=""><a href="classes/chillerlan-QRCode-Data-Number.html#method_write">write()</a></li>
  745. <li class=""><a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method_getCharCount">getCharCount()</a></li>
  746. <li class=""><a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method_getLengthBits">getLengthBits()</a></li>
  747. <li class=""><a href="classes/chillerlan-QRCode-Data-Number.html#method_parseInt">parseInt()</a></li>
  748. </ul>
  749. </li>
  750. </ul>
  751. </section>
  752. </section>
  753. </div>
  754. <section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
  755. <section class="phpdocumentor-search-results__dialog">
  756. <header class="phpdocumentor-search-results__header">
  757. <h2 class="phpdocumentor-search-results__title">Search results</h2>
  758. <button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
  759. </header>
  760. <section class="phpdocumentor-search-results__body">
  761. <ul class="phpdocumentor-search-results__entries"></ul>
  762. </section>
  763. </section>
  764. </section>
  765. </div>
  766. <a href="classes/chillerlan-QRCode-Data-Number.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
  767. </main>
  768. <script>
  769. cssVars({});
  770. </script>
  771. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
  772. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
  773. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
  774. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
  775. </body>
  776. </html>