@@ -13,11 +13,11 @@ code, but instead contain empty function and method bodies. A very basic stub lo
13
13
/** @var float */
14
14
const WEIGHT = 6.8;
15
15
16
- class Atmopshere {
16
+ class Atmosphere {
17
17
public function calculateBar(): float {}
18
18
}
19
19
20
- function fahrenheitToCelcius (float $fahrenheitToCelcius ): float {}
20
+ function fahrenheitToCelsius (float $fahrenheitToCelsius ): float {}
21
21
22
22
Any kind of symbol can be declared via stubs. Every type can be used, with the exception of
23
23
disjunctive normal form (DNF) types. Additional meta information can be added via PHPDoc blocks or
@@ -33,17 +33,17 @@ using namespace blocks:
33
33
/** @var float */
34
34
const WEIGHT_TON = 6.8;
35
35
36
- class Atmopshere {
36
+ class Atmosphere {
37
37
public function calculateBar(): float {}
38
38
}
39
39
}
40
40
41
41
namespace Algorithms {
42
- function fahrenheitToCelcius (float $fahrenheit): float {}
42
+ function fahrenheitToCelsius (float $fahrenheit): float {}
43
43
}
44
44
45
45
The above example declares the global constants ``ANIMAL `` and ``WEIGHT_TON ``, and the class
46
- ``Atmopshere `` in the top-level namespace. The ``fahrenheitToCelcius () `` function is declared to be
46
+ ``Atmosphere `` in the top-level namespace. The ``fahrenheitToCelsius () `` function is declared to be
47
47
in the ``Algorithms `` namespace.
48
48
49
49
********************
@@ -77,11 +77,11 @@ The arginfo file matching our first example looks like:
77
77
/* This is a generated file, edit the .stub.php file instead.
78
78
* Stub hash: e4ed788d54a20272a92a3f6618b73d48ec848f97 */
79
79
80
- ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_fahrenheitToCelcius , 0, 1, IS_DOUBLE, 0)
81
- ZEND_ARG_TYPE_INFO(0, fahrenheitToCelcius , IS_DOUBLE, 0)
80
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_fahrenheitToCelsius , 0, 1, IS_DOUBLE, 0)
81
+ ZEND_ARG_TYPE_INFO(0, fahrenheitToCelsius , IS_DOUBLE, 0)
82
82
ZEND_END_ARG_INFO()
83
83
84
- ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Atmopshere_calculateBar , 0, 0, IS_DOUBLE, 0)
84
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Atmosphere_calculateBar , 0, 0, IS_DOUBLE, 0)
85
85
ZEND_END_ARG_INFO()
86
86
87
87
The hash that is included in the file makes sure that stub files are not reprocessed unless the stub
@@ -186,24 +186,24 @@ In order to generate these, add the file-level ``@generate-function-entries`` PH
186
186
public function calculateBar(): float {}
187
187
}
188
188
189
- function fahrenheitToCelcius (float $fahrenheit): float {}
189
+ function fahrenheitToCelsius (float $fahrenheit): float {}
190
190
191
191
Now, the following C code is generated:
192
192
193
193
.. code :: c
194
194
195
- ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_fahrenheitToCelcius , 0, 1, IS_DOUBLE, 0)
195
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_fahrenheitToCelsius , 0, 1, IS_DOUBLE, 0)
196
196
ZEND_ARG_TYPE_INFO(0, fahrenheit, IS_DOUBLE, 0)
197
197
ZEND_END_ARG_INFO()
198
198
199
199
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Atmosphere_calculateBar, 0, 0, IS_DOUBLE, 0)
200
200
ZEND_END_ARG_INFO()
201
201
202
- ZEND_FUNCTION(fahrenheitToCelcius );
202
+ ZEND_FUNCTION(fahrenheitToCelsius );
203
203
ZEND_METHOD(Atmosphere, calculateBar);
204
204
205
205
static const zend_function_entry ext_functions[] = {
206
- ZEND_FE(fahrenheitToCelcius, arginfo_fahrenheitToCelcius )
206
+ ZEND_FE(fahrenheitToCelsius, arginfo_fahrenheitToCelsius )
207
207
ZEND_FE_END
208
208
};
209
209
@@ -762,7 +762,7 @@ Running it with the stub examples that are used in this guide, the following war
762
762
Warning: Missing class synopsis for Number
763
763
Warning: Missing class synopsis for Elephant
764
764
Warning: Missing class synopsis for Atmosphere
765
- Warning: Missing method synopsis for fahrenheitToCelcius ()
765
+ Warning: Missing method synopsis for fahrenheitToCelsius ()
766
766
Warning: Missing method synopsis for Atmosphere::calculateBar ()
767
767
768
768
**********************
0 commit comments