55use Safe \Exceptions \ApcException ;
66
77/**
8- * apc_cas updates an already existing integer value if the
9- * old parameter matches the currently stored value
8+ * apc_cas updates an already existing integer value if the
9+ * old parameter matches the currently stored value
1010 * with the value of the new parameter.
11- *
11+ *
1212 * @param string $key The key of the value being updated.
1313 * @param int $old The old value (the value currently stored).
1414 * @param int $new The new value to update to.
1515 * @throws ApcException
16- *
16+ *
1717 */
1818function apc_cas (string $ key , int $ old , int $ new ): void
1919{
2020 error_clear_last ();
2121 $ result = \apc_cas ($ key , $ old , $ new );
22- if ($ result === FALSE ) {
22+ if ($ result === false ) {
2323 throw ApcException::createFromPhpError ();
2424 }
2525}
2626
2727
2828/**
2929 * Stores a file in the bytecode cache, bypassing all filters.
30- *
30+ *
3131 * @param string $filename Full or relative path to a PHP file that will be compiled and stored in
3232 * the bytecode cache.
33- * @param bool $atomic
33+ * @param bool $atomic
3434 * @return mixed Returns TRUE on success .
3535 * @throws ApcException
36- *
36+ *
3737 */
3838function apc_compile_file (string $ filename , bool $ atomic = true )
3939{
4040 error_clear_last ();
4141 $ result = \apc_compile_file ($ filename , $ atomic );
42- if ($ result === FALSE ) {
42+ if ($ result === false ) {
4343 throw ApcException::createFromPhpError ();
4444 }
4545 return $ result ;
@@ -48,25 +48,25 @@ function apc_compile_file(string $filename, bool $atomic = true)
4848
4949/**
5050 * Decreases a stored integer value.
51- *
51+ *
5252 * @param string $key The key of the value being decreased.
5353 * @param int $step The step, or value to decrease.
5454 * @param bool $success Optionally pass the success or fail boolean value to
5555 * this referenced variable.
5656 * @return int Returns the current value of key's value on success,
57- *
57+ *
5858 * @throws ApcException
59- *
59+ *
6060 */
6161function apc_dec (string $ key , int $ step = 1 , bool &$ success = null ): int
6262{
6363 error_clear_last ();
6464 if ($ success !== null ) {
6565 $ result = \apc_dec ($ key , $ step , $ success );
66- }else {
66+ } else {
6767 $ result = \apc_dec ($ key , $ step );
6868 }
69- if ($ result === FALSE ) {
69+ if ($ result === false ) {
7070 throw ApcException::createFromPhpError ();
7171 }
7272 return $ result ;
@@ -78,10 +78,10 @@ function apc_dec(string $key, int $step = 1, bool &$success = null): int
7878 * APC is to increase the performance of scripts/applications, this mechanism
7979 * is provided to streamline the process of mass constant definition. However,
8080 * this function does not perform as well as anticipated.
81- *
81+ *
8282 * For a better-performing solution, try the
8383 * hidef extension from PECL.
84- *
84+ *
8585 * @param string $key The key serves as the name of the constant set
8686 * being stored. This key is used to retrieve the
8787 * stored constants in apc_load_constants.
@@ -94,21 +94,21 @@ function apc_dec(string $key, int $step = 1, bool &$success = null): int
9494 * represent different values. If this parameter evaluates to FALSE the
9595 * constants will be declared as case-insensitive symbols.
9696 * @throws ApcException
97- *
97+ *
9898 */
9999function apc_define_constants (string $ key , array $ constants , bool $ case_sensitive = true ): void
100100{
101101 error_clear_last ();
102102 $ result = \apc_define_constants ($ key , $ constants , $ case_sensitive );
103- if ($ result === FALSE ) {
103+ if ($ result === false ) {
104104 throw ApcException::createFromPhpError ();
105105 }
106106}
107107
108108
109109/**
110110 * Deletes the given files from the opcode cache.
111- *
111+ *
112112 * @param mixed $keys The files to be deleted. Accepts a string,
113113 * array of strings, or an APCIterator
114114 * object.
@@ -117,13 +117,13 @@ function apc_define_constants(string $key, array $constants, bool $case_sensitiv
117117 * an empty array is returned on success, or an array of failed files
118118 * is returned.
119119 * @throws ApcException
120- *
120+ *
121121 */
122122function apc_delete_file ($ keys )
123123{
124124 error_clear_last ();
125125 $ result = \apc_delete_file ($ keys );
126- if ($ result === FALSE ) {
126+ if ($ result === false ) {
127127 throw ApcException::createFromPhpError ();
128128 }
129129 return $ result ;
@@ -132,17 +132,17 @@ function apc_delete_file($keys)
132132
133133/**
134134 * Removes a stored variable from the cache.
135- *
135+ *
136136 * @param string|string[]|APCIterator $key The key used to store the value (with
137137 * apc_store).
138138 * @throws ApcException
139- *
139+ *
140140 */
141141function apc_delete (string $ key )
142142{
143143 error_clear_last ();
144144 $ result = \apc_delete ($ key );
145- if ($ result === FALSE ) {
145+ if ($ result === false ) {
146146 throw ApcException::createFromPhpError ();
147147 }
148148 return $ result ;
@@ -151,25 +151,25 @@ function apc_delete(string $key)
151151
152152/**
153153 * Increases a stored number.
154- *
154+ *
155155 * @param string $key The key of the value being increased.
156156 * @param int $step The step, or value to increase.
157157 * @param bool $success Optionally pass the success or fail boolean value to
158158 * this referenced variable.
159159 * @return int Returns the current value of key's value on success,
160- *
160+ *
161161 * @throws ApcException
162- *
162+ *
163163 */
164164function apc_inc (string $ key , int $ step = 1 , bool &$ success = null ): int
165165{
166166 error_clear_last ();
167167 if ($ success !== null ) {
168168 $ result = \apc_inc ($ key , $ step , $ success );
169- }else {
169+ } else {
170170 $ result = \apc_inc ($ key , $ step );
171171 }
172- if ($ result === FALSE ) {
172+ if ($ result === false ) {
173173 throw ApcException::createFromPhpError ();
174174 }
175175 return $ result ;
@@ -178,23 +178,21 @@ function apc_inc(string $key, int $step = 1, bool &$success = null): int
178178
179179/**
180180 * Loads a set of constants from the cache.
181- *
181+ *
182182 * @param string $key The name of the constant set (that was stored with
183183 * apc_define_constants) to be retrieved.
184184 * @param bool $case_sensitive The default behaviour for constants is to be declared case-sensitive;
185185 * i.e. CONSTANT and Constant
186186 * represent different values. If this parameter evaluates to FALSE the
187187 * constants will be declared as case-insensitive symbols.
188188 * @throws ApcException
189- *
189+ *
190190 */
191191function apc_load_constants (string $ key , bool $ case_sensitive = true ): void
192192{
193193 error_clear_last ();
194194 $ result = \apc_load_constants ($ key , $ case_sensitive );
195- if ($ result === FALSE ) {
195+ if ($ result === false ) {
196196 throw ApcException::createFromPhpError ();
197197 }
198198}
199-
200-
0 commit comments